mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-01 04:47:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
14
dom/interfaces/apps/moz.build
Normal file
14
dom/interfaces/apps/moz.build
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'mozIApplication.idl',
|
||||
'mozIApplicationClearPrivateDataParams.idl',
|
||||
'nsIAppsService.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_apps'
|
||||
|
||||
60
dom/interfaces/apps/mozIApplication.idl
Normal file
60
dom/interfaces/apps/mozIApplication.idl
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=8 et :
|
||||
*/
|
||||
/* 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 nsIPrincipal;
|
||||
|
||||
/**
|
||||
* We expose Gecko-internal helpers related to "web apps" through this
|
||||
* sub-interface.
|
||||
*/
|
||||
[scriptable, uuid(e76aa5e0-80b2-404f-bccc-1067828bb6ed)]
|
||||
interface mozIApplication: nsISupports
|
||||
{
|
||||
/* Return true if this app has |permission|. */
|
||||
boolean hasPermission(in string permission);
|
||||
|
||||
/* Application status as defined in nsIPrincipal. */
|
||||
readonly attribute unsigned short appStatus;
|
||||
|
||||
/* Returns the uuid of the app. */
|
||||
readonly attribute DOMString id;
|
||||
|
||||
/* Returns the origin of the app. */
|
||||
readonly attribute DOMString origin;
|
||||
|
||||
/* Returns the manifest url of the app. */
|
||||
readonly attribute DOMString manifestURL;
|
||||
|
||||
/* Returns the local id of the app. */
|
||||
readonly attribute unsigned long localId;
|
||||
|
||||
/* Returns the base directory for the app */
|
||||
readonly attribute DOMString basePath;
|
||||
|
||||
/* Name copied from the manifest */
|
||||
readonly attribute DOMString name;
|
||||
|
||||
/* CSP copied from the manifest */
|
||||
readonly attribute DOMString csp;
|
||||
|
||||
/* Store ID if the app is installed from a store */
|
||||
readonly attribute DOMString storeID;
|
||||
|
||||
/* Store version if the app is installed from a store */
|
||||
readonly attribute unsigned long storeVersion;
|
||||
|
||||
/* role copied from the manifest */
|
||||
readonly attribute DOMString role;
|
||||
|
||||
/* Returns the kind of the app. */
|
||||
readonly attribute DOMString kind;
|
||||
|
||||
/* Returns the app's principal */
|
||||
readonly attribute nsIPrincipal principal;
|
||||
};
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=8 et :
|
||||
*/
|
||||
/* 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(ba0e6c8e-8c03-4b9b-8f9b-4fb14216f56e)]
|
||||
interface mozIApplicationClearPrivateDataParams : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long appId;
|
||||
readonly attribute boolean browserOnly;
|
||||
};
|
||||
|
||||
%{C++
|
||||
#define TOPIC_WEB_APP_CLEAR_DATA "webapps-clear-data"
|
||||
#define TOPIC_CLEAR_ORIGIN_DATA "clear-origin-attributes-data"
|
||||
%}
|
||||
75
dom/interfaces/apps/nsIAppsService.idl
Normal file
75
dom/interfaces/apps/nsIAppsService.idl
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* 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 mozIApplication;
|
||||
interface nsIURI;
|
||||
|
||||
%{C++
|
||||
#define APPS_SERVICE_CID { 0x05072afa, 0x92fe, 0x45bf, { 0xae, 0x22, 0x39, 0xb6, 0x9c, 0x11, 0x70, 0x58 } }
|
||||
#define APPS_SERVICE_CONTRACTID "@mozilla.org/AppsService;1"
|
||||
%}
|
||||
|
||||
/*
|
||||
* This service allows accessing some DOMApplicationRegistry methods from
|
||||
* non-javascript code.
|
||||
*/
|
||||
[scriptable, uuid(711cfab6-7b72-4aa2-a60c-17952ea05661)]
|
||||
interface nsIAppsService : nsISupports
|
||||
{
|
||||
mozIApplication getAppByManifestURL(in DOMString manifestURL);
|
||||
|
||||
/**
|
||||
* Returns a Promise for the manifest for a given manifestURL.
|
||||
* This is only supported in the parent process: the promise will be rejected
|
||||
* in content processes.
|
||||
*/
|
||||
jsval getManifestFor(in DOMString manifestURL);
|
||||
|
||||
/**
|
||||
* Returns the |localId| of the app associated with the |manifestURL| passed
|
||||
* in parameter.
|
||||
* Returns nsIScriptSecurityManager::NO_APP_ID if |manifestURL| isn't a valid
|
||||
* installed manifest URL.
|
||||
*/
|
||||
unsigned long getAppLocalIdByManifestURL(in DOMString manifestURL);
|
||||
|
||||
/**
|
||||
* Returns the application associated to this localId.
|
||||
*/
|
||||
mozIApplication getAppByLocalId(in unsigned long localId);
|
||||
|
||||
/**
|
||||
* Returns the manifest URL associated to this localId.
|
||||
*/
|
||||
DOMString getManifestURLByLocalId(in unsigned long localId);
|
||||
|
||||
/**
|
||||
* Returns the basepath for core apps
|
||||
*/
|
||||
DOMString getCoreAppsBasePath();
|
||||
|
||||
/**
|
||||
* Returns the basepath for regular packaged apps
|
||||
*/
|
||||
DOMString getWebAppsBasePath();
|
||||
|
||||
/**
|
||||
* Returns true if at least one app is in the registry.
|
||||
*/
|
||||
boolean areAnyAppsInstalled();
|
||||
|
||||
jsval getAppInfo(in DOMString appId);
|
||||
|
||||
/**
|
||||
* Returns the localId if the app was installed from a store
|
||||
*/
|
||||
DOMString getAppLocalIdByStoreId(in DOMString storeID);
|
||||
|
||||
/**
|
||||
* Returns the scope for app to use with service workers.
|
||||
*/
|
||||
DOMString getScopeByLocalId(in unsigned long localId);
|
||||
};
|
||||
81
dom/interfaces/base/domstubs.idl
Normal file
81
dom/interfaces/base/domstubs.idl
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/* -*- 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"
|
||||
|
||||
%{C++
|
||||
class nsWrapperCache;
|
||||
%}
|
||||
|
||||
[ptr] native nsWrapperCachePtr(nsWrapperCache);
|
||||
|
||||
typedef unsigned long long DOMTimeStamp;
|
||||
typedef double DOMHighResTimeStamp;
|
||||
|
||||
// Core
|
||||
interface nsIDOMAttr;
|
||||
interface nsIDOMCDATASection;
|
||||
interface nsIDOMCharacterData;
|
||||
interface nsIDOMComment;
|
||||
interface nsIDOMDOMImplementation;
|
||||
interface nsIDOMDocument;
|
||||
interface nsIDOMDocumentFragment;
|
||||
interface nsIDOMDocumentType;
|
||||
interface nsIDOMElement;
|
||||
interface nsIDOMNode;
|
||||
interface nsIDOMNodeList;
|
||||
interface nsIDOMProcessingInstruction;
|
||||
interface nsIDOMText;
|
||||
interface nsIDOMClientRect;
|
||||
interface nsIDOMClientRectList;
|
||||
|
||||
// Needed for raises() in our IDL
|
||||
interface DOMException;
|
||||
|
||||
// Style Sheets
|
||||
interface nsIDOMStyleSheetList;
|
||||
interface nsIDOMStyleSheet;
|
||||
interface nsIDOMMediaList;
|
||||
|
||||
// Base
|
||||
interface nsIDOMWindow;
|
||||
interface nsIDOMWindowCollection;
|
||||
interface nsIDOMNavigator;
|
||||
interface nsIDOMScreen;
|
||||
|
||||
// Events
|
||||
interface nsIDOMEvent;
|
||||
interface nsIDOMEventTarget;
|
||||
interface nsIDOMEventListener;
|
||||
|
||||
// HTML
|
||||
interface nsIDOMHTMLElement;
|
||||
interface nsIDOMHTMLFormElement;
|
||||
interface nsIDOMHTMLCollection;
|
||||
interface nsIDOMHTMLHeadElement;
|
||||
|
||||
// CSS
|
||||
interface nsIDOMCSSValue;
|
||||
interface nsIDOMCSSPrimitiveValue;
|
||||
interface nsIDOMCSSRule;
|
||||
interface nsIDOMCSSRuleList;
|
||||
interface nsIDOMCSSKeyframeRule;
|
||||
interface nsIDOMCSSFontFeatureValuesRule;
|
||||
interface nsIDOMCSSStyleSheet;
|
||||
interface nsIDOMCSSStyleDeclaration;
|
||||
interface nsIDOMCounter;
|
||||
interface nsIDOMRect;
|
||||
interface nsIDOMCSSStyleRule;
|
||||
interface nsIDOMCSSStyleRuleCollection;
|
||||
|
||||
// Range
|
||||
interface nsIDOMRange;
|
||||
|
||||
// Crypto
|
||||
interface nsIDOMCrypto;
|
||||
|
||||
// Used font face (for inspector)
|
||||
interface nsIDOMFontFace;
|
||||
interface nsIDOMFontFaceList;
|
||||
42
dom/interfaces/base/moz.build
Normal file
42
dom/interfaces/base/moz.build
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'domstubs.idl',
|
||||
'nsIBrowser.idl',
|
||||
'nsIBrowserDOMWindow.idl',
|
||||
'nsIContentPermissionPrompt.idl',
|
||||
'nsIContentPrefService.idl',
|
||||
'nsIContentPrefService2.idl',
|
||||
'nsIContentURIGrouper.idl',
|
||||
'nsIDOMChromeWindow.idl',
|
||||
'nsIDOMClientRect.idl',
|
||||
'nsIDOMClientRectList.idl',
|
||||
'nsIDOMConstructor.idl',
|
||||
'nsIDOMCrypto.idl',
|
||||
'nsIDOMGlobalPropertyInitializer.idl',
|
||||
'nsIDOMHistory.idl',
|
||||
'nsIDOMLocation.idl',
|
||||
'nsIDOMModalContentWindow.idl',
|
||||
'nsIDOMNavigator.idl',
|
||||
'nsIDOMScreen.idl',
|
||||
'nsIDOMWindow.idl',
|
||||
'nsIDOMWindowCollection.idl',
|
||||
'nsIDOMWindowUtils.idl',
|
||||
'nsIFocusManager.idl',
|
||||
'nsIIdleObserver.idl',
|
||||
'nsIQueryContentEventResult.idl',
|
||||
'nsIRemoteBrowser.idl',
|
||||
'nsIServiceWorkerManager.idl',
|
||||
'nsIStructuredCloneContainer.idl',
|
||||
'nsITabChild.idl',
|
||||
'nsITabParent.idl',
|
||||
'nsITextInputProcessor.idl',
|
||||
'nsITextInputProcessorCallback.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_base'
|
||||
|
||||
46
dom/interfaces/base/nsIBrowser.idl
Normal file
46
dom/interfaces/base/nsIBrowser.idl
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/* 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 nsIDOMElement;
|
||||
|
||||
[scriptable, uuid(14e5a0cb-e223-4202-95e8-fe53275193ea)]
|
||||
interface nsIBrowser : nsISupports
|
||||
{
|
||||
/**
|
||||
* Gets a related browser for a given browser (if any). If this exists, then
|
||||
* we should attempt to use the same content parent as its frameLoader
|
||||
* for any new tab parents.
|
||||
*/
|
||||
readonly attribute nsIDOMElement relatedBrowser;
|
||||
|
||||
/*
|
||||
* Called by the child to inform the parent that links are dropped into
|
||||
* content area.
|
||||
*
|
||||
* @param linksCount length of links
|
||||
* @param links a flat array of url, name, and type for each link
|
||||
*/
|
||||
void dropLinks(in unsigned long linksCount,
|
||||
[array, size_is(linksCount)] in wstring links);
|
||||
|
||||
/**
|
||||
* Swapping of frameloaders are usually initiated from a frameloader owner
|
||||
* or other components operating on frameloader owners. This is done by calling
|
||||
* swapFrameLoaders at MozFrameLoaderOwner webidl interface.
|
||||
*
|
||||
* This function aimed to provide the other way around -
|
||||
* if the swapping is initiated from frameloader itself or other platform level
|
||||
* components, it uses this interface to delegate the swapping request to
|
||||
* frameloader owners and ask them to re-initiate frameloader swapping, so that
|
||||
* frameloader owners such as <xul:browser> can setup their properties and /
|
||||
* or listeners properly on swapping.
|
||||
*/
|
||||
void swapBrowsers(in nsIBrowser aOtherBrowser);
|
||||
|
||||
/**
|
||||
* Close the browser (usually means to remove a tab).
|
||||
*/
|
||||
void closeBrowser();
|
||||
};
|
||||
129
dom/interfaces/base/nsIBrowserDOMWindow.idl
Normal file
129
dom/interfaces/base/nsIBrowserDOMWindow.idl
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
/* -*- 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 mozIDOMWindowProxy;
|
||||
interface nsIDOMWindow;
|
||||
interface nsIURI;
|
||||
interface nsIFrameLoaderOwner;
|
||||
|
||||
[scriptable, uuid(e774db14-79ac-4156-a7a3-aa3fd0a22c10)]
|
||||
interface nsIOpenURIInFrameParams : nsISupports
|
||||
{
|
||||
attribute DOMString referrer;
|
||||
attribute boolean isPrivate;
|
||||
|
||||
[implicit_jscontext]
|
||||
readonly attribute jsval openerOriginAttributes;
|
||||
};
|
||||
|
||||
[scriptable, uuid(9d17f3dd-672b-451e-afd2-b1115df780d5)]
|
||||
|
||||
/**
|
||||
* The C++ source has access to the browser script source through
|
||||
* nsIBrowserDOMWindow. It is intended to be attached to the chrome DOMWindow
|
||||
* of a toplevel browser window (a XUL window). A DOMWindow that does not
|
||||
* happen to be a browser chrome window will simply have no access to any such
|
||||
* interface.
|
||||
*/
|
||||
interface nsIBrowserDOMWindow : nsISupports
|
||||
{
|
||||
/**
|
||||
* Values for openURI's aWhere parameter.
|
||||
*/
|
||||
/**
|
||||
* Do whatever the default is based on application state, user preferences,
|
||||
* and the value of the aContext parameter to openURI.
|
||||
*/
|
||||
const short OPEN_DEFAULTWINDOW = 0;
|
||||
/**
|
||||
* Open in the "current window". If aOpener is provided, this should be the
|
||||
* top window in aOpener's window hierarchy, but exact behavior is
|
||||
* application-dependent. If aOpener is not provided, it's up to the
|
||||
* application to decide what constitutes a "current window".
|
||||
*/
|
||||
const short OPEN_CURRENTWINDOW = 1;
|
||||
/**
|
||||
* Open in a new window.
|
||||
*/
|
||||
const short OPEN_NEWWINDOW = 2;
|
||||
/**
|
||||
* Open in a new content tab in the toplevel browser window corresponding to
|
||||
* this nsIBrowserDOMWindow.
|
||||
*/
|
||||
const short OPEN_NEWTAB = 3;
|
||||
/**
|
||||
* Open in an existing content tab based on the URI. If a match can't be
|
||||
* found, revert to OPEN_NEWTAB behavior.
|
||||
*/
|
||||
const short OPEN_SWITCHTAB = 4;
|
||||
|
||||
/**
|
||||
* Values for openURI's aFlags parameter. This is a bitflags field.
|
||||
*
|
||||
* The 0x1 bit decides the behavior of OPEN_DEFAULTWINDOW, and the 0x4 bit
|
||||
* controls whether or not to set the window.opener property on the newly
|
||||
* opened window.
|
||||
*
|
||||
* NOTE: The 0x2 bit is ignored for backwards compatibility with addons, as
|
||||
* OPEN_NEW used to have the value 2. The values 0 and 2 are treated
|
||||
* the same way internally.
|
||||
*/
|
||||
/**
|
||||
* internal open new window
|
||||
*/
|
||||
const long OPEN_NEW = 0x0;
|
||||
/**
|
||||
* external link (load request from another application, xremote, etc).
|
||||
*/
|
||||
const long OPEN_EXTERNAL = 0x1;
|
||||
|
||||
/**
|
||||
* Don't set the window.opener property on the window which is being opened
|
||||
*/
|
||||
const long OPEN_NO_OPENER = 0x4;
|
||||
|
||||
/**
|
||||
* Load a URI
|
||||
|
||||
* @param aURI the URI to open. null is allowed. If null is passed in, no
|
||||
* load will be done, though the window the load would have
|
||||
* happened in will be returned.
|
||||
* @param aWhere see possible values described above.
|
||||
* @param aOpener window requesting the open (can be null).
|
||||
* @param aFlags flags which control the behavior of the load. The
|
||||
* OPEN_EXTERNAL/OPEN_NEW flag is only used when
|
||||
* aWhere == OPEN_DEFAULTWINDOW.
|
||||
* @return the window into which the URI was opened.
|
||||
*/
|
||||
mozIDOMWindowProxy
|
||||
openURI(in nsIURI aURI, in mozIDOMWindowProxy aOpener,
|
||||
in short aWhere, in long aFlags);
|
||||
|
||||
/**
|
||||
* As above, but return the nsIFrameLoaderOwner for the new window.
|
||||
// XXXbz is this the right API?
|
||||
// See bug 537428
|
||||
*/
|
||||
nsIFrameLoaderOwner openURIInFrame(in nsIURI aURI, in nsIOpenURIInFrameParams params,
|
||||
in short aWhere, in long aFlags);
|
||||
|
||||
/**
|
||||
* @param aWindow the window to test.
|
||||
* @return whether the window is the main content window for any
|
||||
* currently open tab in this toplevel browser window.
|
||||
*/
|
||||
boolean isTabContentWindow(in nsIDOMWindow aWindow);
|
||||
|
||||
/**
|
||||
* This function is responsible for calling
|
||||
* nsIContentViewer::PermitUnload on each frame in the window. It
|
||||
* returns true if closing the window is allowed. See canClose() in
|
||||
* BrowserUtils.jsm for a simple implementation of this method.
|
||||
*/
|
||||
boolean canClose();
|
||||
};
|
||||
|
||||
119
dom/interfaces/base/nsIContentPermissionPrompt.idl
Normal file
119
dom/interfaces/base/nsIContentPermissionPrompt.idl
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/* 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 nsIPrincipal;
|
||||
interface mozIDOMWindow;
|
||||
interface nsIDOMElement;
|
||||
interface nsIArray;
|
||||
|
||||
/**
|
||||
* Interface provides the request type and its access.
|
||||
*/
|
||||
[scriptable, uuid(ef4db3b8-ca9c-4b1d-8f81-fd88ec32af13)]
|
||||
interface nsIContentPermissionType : nsISupports {
|
||||
/**
|
||||
* The type of the permission request, such as
|
||||
* "geolocation".
|
||||
*/
|
||||
readonly attribute ACString type;
|
||||
|
||||
/**
|
||||
* The access of the permission request, such as
|
||||
* "read".
|
||||
*/
|
||||
readonly attribute ACString access;
|
||||
|
||||
/**
|
||||
* The array of available options.
|
||||
*/
|
||||
readonly attribute nsIArray options; // ["choice1", "choice2"]
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface provides the callback type.
|
||||
*/
|
||||
[scriptable, uuid(5fb5bb60-7069-11e4-9803-0800200c9a66)]
|
||||
interface nsIContentPermissionRequestCallback : nsISupports {
|
||||
/**
|
||||
* The callback of the visibility result.
|
||||
*/
|
||||
void notifyVisibility(in boolean isVisible);
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface provides the way to get the visibility and
|
||||
* the notification.
|
||||
*/
|
||||
[scriptable, uuid(f8577124-6a5f-486f-ae04-c5bcae911eb5)]
|
||||
interface nsIContentPermissionRequester : nsISupports {
|
||||
/**
|
||||
* The function to get the visibility.
|
||||
*/
|
||||
void getVisibility(in nsIContentPermissionRequestCallback callback);
|
||||
|
||||
/**
|
||||
* The callback to get the notification of visibility change.
|
||||
*/
|
||||
attribute nsIContentPermissionRequestCallback onVisibilityChange;
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface allows access to a content to request
|
||||
* permission to perform a privileged operation such as
|
||||
* geolocation.
|
||||
*/
|
||||
[scriptable, uuid(875733da-0ac0-4a26-8c76-70a30876be46)]
|
||||
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;
|
||||
|
||||
/**
|
||||
* The window or element that the permission request was
|
||||
* originated in. Typically the element will be non-null
|
||||
* in when using out of process content. window or
|
||||
* element can be null but not both.
|
||||
*/
|
||||
readonly attribute mozIDOMWindow window;
|
||||
readonly attribute nsIDOMElement element;
|
||||
|
||||
/**
|
||||
* The requester to get the required information of
|
||||
* the window.
|
||||
*/
|
||||
readonly attribute nsIContentPermissionRequester requester;
|
||||
|
||||
/**
|
||||
* allow or cancel the request
|
||||
*/
|
||||
|
||||
void cancel();
|
||||
void allow([optional] in jsval choices); // {"type1": "choice1", "type2": "choiceA"}
|
||||
};
|
||||
|
||||
/**
|
||||
* Interface provides a way for the application to handle
|
||||
* the UI prompts associated with geo position.
|
||||
*/
|
||||
[scriptable, function, uuid(F72DE90D-E954-4E69-9A61-917303029301)]
|
||||
interface nsIContentPermissionPrompt : nsISupports {
|
||||
/**
|
||||
* Called when a request has been made to access
|
||||
* privileged content apis
|
||||
*/
|
||||
void prompt(in nsIContentPermissionRequest request);
|
||||
};
|
||||
|
||||
%{C++
|
||||
#define NS_CONTENT_PERMISSION_PROMPT_CONTRACTID "@mozilla.org/content-permission/prompt;1"
|
||||
%}
|
||||
263
dom/interfaces/base/nsIContentPrefService.idl
Normal file
263
dom/interfaces/base/nsIContentPrefService.idl
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
/* 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 nsIVariant;
|
||||
interface nsIPropertyBag2;
|
||||
interface nsIContentURIGrouper;
|
||||
interface nsILoadContext;
|
||||
interface mozIStorageConnection;
|
||||
|
||||
[scriptable, uuid(43635c53-b445-4c4e-8cc5-562697299b55)]
|
||||
interface nsIContentPrefObserver : nsISupports
|
||||
{
|
||||
/**
|
||||
* Called when a content pref is set to a different value.
|
||||
*
|
||||
* @param aGroup the group to which the pref belongs, or null
|
||||
* if it's a global pref (applies to all sites)
|
||||
* @param aName the name of the pref that was set
|
||||
* @param aValue the new value of the pref
|
||||
* @param aIsPrivate an optional flag determining whether the
|
||||
* original context is private or not
|
||||
*/
|
||||
void onContentPrefSet(in AString aGroup,
|
||||
in AString aName,
|
||||
in nsIVariant aValue,
|
||||
[optional] in boolean aIsPrivate);
|
||||
|
||||
/**
|
||||
* Called when a content pref is removed.
|
||||
*
|
||||
* @param aGroup the group to which the pref belongs, or null
|
||||
* if it's a global pref (applies to all sites)
|
||||
* @param aName the name of the pref that was removed
|
||||
* @param aIsPrivate an optional flag determining whether the
|
||||
* original context is private or not
|
||||
*/
|
||||
void onContentPrefRemoved(in AString aGroup,
|
||||
in AString aName,
|
||||
[optional] in boolean aIsPrivate);
|
||||
};
|
||||
|
||||
[scriptable, function, uuid(c1b3d6df-5373-4606-8494-8bcf14a7fc62)]
|
||||
interface nsIContentPrefCallback : nsISupports
|
||||
{
|
||||
void onResult(in nsIVariant aResult);
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Please use nsIContentPrefService2 instead.
|
||||
*/
|
||||
[scriptable, uuid(e3f772f3-023f-4b32-b074-36cf0fd5d414)]
|
||||
interface nsIContentPrefService : nsISupports
|
||||
{
|
||||
/**
|
||||
* Get a pref.
|
||||
*
|
||||
* Besides the regular string, integer, boolean, etc. values, this method
|
||||
* may return null (nsIDataType::VTYPE_EMPTY), which means the pref is set
|
||||
* to NULL in the database, as well as undefined (nsIDataType::VTYPE_VOID),
|
||||
* which means there is no record for this pref in the database.
|
||||
*
|
||||
* This method can be called from content processes in electrolysis builds.
|
||||
* We have a whitelist of values that can be read in such a way.
|
||||
*
|
||||
* @param aGroup the group for which to get the pref, as an nsIURI
|
||||
* from which the hostname will be used, a string
|
||||
* (typically in the format of a hostname), or null
|
||||
* to get the global pref (applies to all sites)
|
||||
* @param aName the name of the pref to get
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to search in memory or in
|
||||
* permanent storage for it), obtained from a relevant
|
||||
* window or channel.
|
||||
* @param aCallback an optional nsIContentPrefCallback to receive the
|
||||
* result. If desired, JavaScript callers can instead
|
||||
* provide a function to call upon completion
|
||||
*
|
||||
* @returns the value of the pref
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aGroup is not a string, nsIURI, or null
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
nsIVariant getPref(in nsIVariant aGroup, in AString aName,
|
||||
in nsILoadContext aPrivacyContext,
|
||||
[optional] in nsIContentPrefCallback aCallback);
|
||||
|
||||
/**
|
||||
* Set a pref.
|
||||
*
|
||||
* This method can be called from content processes in electrolysis builds.
|
||||
* We have a whitelist of values that can be set in such a way.
|
||||
*
|
||||
* @param aGroup the group for which to set the pref, as an nsIURI
|
||||
* from which the hostname will be used, a string
|
||||
* (typically in the format of a hostname), or null
|
||||
* to set the global pref (applies to all sites)
|
||||
* @param aName the name of the pref to set
|
||||
* @param aValue the new value of the pref
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to store it in memory or in
|
||||
* permanent storage), obtained from a relevant
|
||||
* window or channel.
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aGroup is not a string, nsIURI, or null
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
void setPref(in nsIVariant aGroup, in AString aName, in nsIVariant aValue, in nsILoadContext aPrivacyContext);
|
||||
|
||||
/**
|
||||
* Check whether or not a pref exists.
|
||||
*
|
||||
* @param aGroup the group for which to check for the pref, as an nsIURI
|
||||
* from which the hostname will be used, a string
|
||||
* (typically in the format of a hostname), or null
|
||||
* to check for the global pref (applies to all sites)
|
||||
* @param aName the name of the pref to check for
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to search in memory or in
|
||||
* permanent storage for it), obtained from a relevant
|
||||
* window or channel.
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aGroup is not a string, nsIURI, or null
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
boolean hasPref(in nsIVariant aGroup, in AString aName, in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Check whether or not the value of a pref (or its non-existance) is cached.
|
||||
*
|
||||
* @param aGroup the group for which to check for the pref, as an nsIURI
|
||||
* from which the hostname will be used, a string
|
||||
* (typically in the format of a hostname), or null
|
||||
* to check for the global pref (applies to all sites)
|
||||
* @param aName the name of the pref to check for
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to search in memory or in
|
||||
* permanent storage for it), obtained from a relevant
|
||||
* window or channel.
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aGroup is not a string, nsIURI, or null
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
boolean hasCachedPref(in nsIVariant aGroup, in AString aName, in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Remove a pref.
|
||||
*
|
||||
* @param aGroup the group for which to remove the pref, as an nsIURI
|
||||
* from which the hostname will be used, a string
|
||||
* (typically in the format of a hostname), or null
|
||||
* to remove the global pref (applies to all sites)
|
||||
* @param aName the name of the pref to remove
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to search in memory or in
|
||||
* permanent storage for it), obtained from a relevant
|
||||
* window or channel.
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aGroup is not a string, nsIURI, or null
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
void removePref(in nsIVariant aGroup, in AString aName, in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Remove all grouped prefs. Useful for removing references to the sites
|
||||
* the user has visited when the user clears their private data.
|
||||
*
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to remove prefs in memory or
|
||||
* in permanent storage), obtained from a relevant
|
||||
* window or channel.
|
||||
*/
|
||||
void removeGroupedPrefs(in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Remove all prefs with the given name.
|
||||
*
|
||||
* @param aName the setting name for which to remove prefs
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the prefs (ie. whether to remove prefs in memory or
|
||||
* in permanent storage), obtained from a relevant
|
||||
* window or channel.
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
void removePrefsByName(in AString aName, in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Get the prefs that apply to the given site.
|
||||
*
|
||||
* @param aGroup the group for which to retrieve prefs, as an nsIURI
|
||||
* from which the hostname will be used, a string
|
||||
* (typically in the format of a hostname), or null
|
||||
* to get the global prefs (apply to all sites)
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to search for prefs in memory
|
||||
* or in permanent storage), obtained from a relevant
|
||||
* window or channel.
|
||||
*
|
||||
* @returns a property bag of prefs
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aGroup is not a string, nsIURI, or null
|
||||
*/
|
||||
nsIPropertyBag2 getPrefs(in nsIVariant aGroup, in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Get the prefs with the given name.
|
||||
*
|
||||
* @param aName the setting name for which to retrieve prefs
|
||||
* @param aPrivacyContext
|
||||
* a context from which to determine the privacy status
|
||||
* of the pref (ie. whether to search for prefs in memory
|
||||
* or in permanent storage), obtained from a relevant
|
||||
* window or channel.
|
||||
*
|
||||
* @returns a property bag of prefs
|
||||
* @throws NS_ERROR_ILLEGAL_VALUE if aName is null or an empty string
|
||||
*/
|
||||
nsIPropertyBag2 getPrefsByName(in AString aName, in nsILoadContext aContext);
|
||||
|
||||
/**
|
||||
* Add an observer.
|
||||
*
|
||||
* @param aName the setting to observe, or null to add
|
||||
* a generic observer that observes all settings
|
||||
* @param aObserver the observer to add
|
||||
*/
|
||||
void addObserver(in AString aName, in nsIContentPrefObserver aObserver);
|
||||
|
||||
/**
|
||||
* Remove an observer.
|
||||
*
|
||||
* @param aName the setting being observed, or null to remove
|
||||
* a generic observer that observes all settings
|
||||
* @param aObserver the observer to remove
|
||||
*/
|
||||
void removeObserver(in AString aName, in nsIContentPrefObserver aObserver);
|
||||
|
||||
/**
|
||||
* The component that the service uses to determine the groups to which
|
||||
* URIs belong. By default this is the "hostname grouper", which groups
|
||||
* URIs by full hostname (a.k.a. site).
|
||||
*/
|
||||
readonly attribute nsIContentURIGrouper grouper;
|
||||
|
||||
/**
|
||||
* The database connection to the content preferences database.
|
||||
* Useful for accessing and manipulating preferences in ways that are caller-
|
||||
* specific or for which there is not yet a generic method, although generic
|
||||
* functionality useful to multiple callers should generally be added to this
|
||||
* unfrozen interface. Also useful for testing the database creation
|
||||
* and migration code.
|
||||
*/
|
||||
readonly attribute mozIStorageConnection DBConnection;
|
||||
};
|
||||
|
||||
%{C++
|
||||
// The contractID for the generic implementation built in to xpcom.
|
||||
#define NS_CONTENT_PREF_SERVICE_CONTRACTID "@mozilla.org/content-pref/service;1"
|
||||
%}
|
||||
405
dom/interfaces/base/nsIContentPrefService2.idl
Normal file
405
dom/interfaces/base/nsIContentPrefService2.idl
Normal file
|
|
@ -0,0 +1,405 @@
|
|||
/* 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 nsIVariant;
|
||||
interface nsIContentPrefObserver;
|
||||
interface nsIContentPrefCallback2;
|
||||
interface nsILoadContext;
|
||||
interface nsIContentPref;
|
||||
|
||||
/**
|
||||
* Content Preferences
|
||||
*
|
||||
* Content preferences allow the application to associate arbitrary data, or
|
||||
* "preferences", with specific domains, or web "content". Specifically, a
|
||||
* content preference is a structure with three values: a domain with which the
|
||||
* preference is associated, a name that identifies the preference within its
|
||||
* domain, and a value. (See nsIContentPref below.)
|
||||
*
|
||||
* For example, if you want to remember the user's preference for a certain zoom
|
||||
* level on www.mozilla.org pages, you might store a preference whose domain is
|
||||
* "www.mozilla.org", whose name is "zoomLevel", and whose value is the numeric
|
||||
* zoom level.
|
||||
*
|
||||
* A preference need not have a domain, and in that case the preference is
|
||||
* called a "global" preference. This interface doesn't impart any special
|
||||
* significance to global preferences; they're simply name-value pairs that
|
||||
* aren't associated with any particular domain. As a consumer of this
|
||||
* interface, you might choose to let a global preference override all non-
|
||||
* global preferences of the same name, for example, for whatever definition of
|
||||
* "override" is appropriate for your use case.
|
||||
*
|
||||
*
|
||||
* Domain Parameters
|
||||
*
|
||||
* Many methods of this interface accept a "domain" parameter. Domains may be
|
||||
* specified either exactly, like "example.com", or as full URLs, like
|
||||
* "http://example.com/foo/bar". In the latter case the API extracts the full
|
||||
* domain from the URL, so if you specify "http://foo.bar.example.com/baz", the
|
||||
* domain is taken to be "foo.bar.example.com", not "example.com".
|
||||
*
|
||||
*
|
||||
* Private-Browsing Context Parameters
|
||||
*
|
||||
* Many methods also accept a "context" parameter. This parameter relates to
|
||||
* private browsing and determines the kind of storage that a method uses,
|
||||
* either the usual permanent storage or temporary storage set aside for private
|
||||
* browsing sessions.
|
||||
*
|
||||
* Pass null to unconditionally use permanent storage. Pass an nsILoadContext
|
||||
* to use storage appropriate to the context's usePrivateBrowsing attribute: if
|
||||
* usePrivateBrowsing is true, temporary private-browsing storage is used, and
|
||||
* otherwise permanent storage is used. A context can be obtained from the
|
||||
* window or channel whose content pertains to the preferences being modified or
|
||||
* retrieved.
|
||||
*
|
||||
*
|
||||
* Callbacks
|
||||
*
|
||||
* The methods of callback objects are always called asynchronously.
|
||||
*
|
||||
* Observers are called after callbacks are called, but they are called in the
|
||||
* same turn of the event loop as callbacks.
|
||||
*
|
||||
* See nsIContentPrefCallback2 below for more information about callbacks.
|
||||
*/
|
||||
|
||||
[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.
|
||||
* @param name The preference's name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleResult is called once unless no such preference
|
||||
* exists, in which case handleResult is not called at all.
|
||||
*/
|
||||
void getByDomainAndName(in AString domain,
|
||||
in AString name,
|
||||
in nsILoadContext context,
|
||||
in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Gets all preferences with the given name whose domains are either the same
|
||||
* as or subdomains of the given domain.
|
||||
*
|
||||
* @param domain The preferences' domain.
|
||||
* @param name The preferences' name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleResult is called once for each preference. If no
|
||||
* such preferences exist, handleResult is not called at all.
|
||||
*/
|
||||
void getBySubdomainAndName(in AString domain,
|
||||
in AString name,
|
||||
in nsILoadContext context,
|
||||
in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Gets the preference with no domain and the given name.
|
||||
*
|
||||
* @param name The preference's name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleResult is called once unless no such preference
|
||||
* exists, in which case handleResult is not called at all.
|
||||
*/
|
||||
void getGlobal(in AString name,
|
||||
in nsILoadContext context,
|
||||
in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Synchronously retrieves from the in-memory cache the preference with the
|
||||
* given domain and name.
|
||||
*
|
||||
* In addition to caching preference values, the cache also keeps track of
|
||||
* preferences that are known not to exist. If the preference is known not to
|
||||
* exist, the value attribute of the returned object will be undefined
|
||||
* (nsIDataType::VTYPE_VOID).
|
||||
*
|
||||
* If the preference is neither cached nor known not to exist, then null is
|
||||
* returned, and get() must be called to determine whether the preference
|
||||
* exists.
|
||||
*
|
||||
* @param domain The preference's domain.
|
||||
* @param name The preference's name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @return The preference, or null if no such preference is known to
|
||||
* exist.
|
||||
*/
|
||||
nsIContentPref getCachedByDomainAndName(in AString domain,
|
||||
in AString name,
|
||||
in nsILoadContext context);
|
||||
|
||||
/**
|
||||
* Synchronously retrieves from the in-memory cache all preferences with the
|
||||
* given name whose domains are either the same as or subdomains of the given
|
||||
* domain.
|
||||
*
|
||||
* The preferences are returned in an array through the out-parameter. If a
|
||||
* preference for a particular subdomain is known not to exist, then an object
|
||||
* corresponding to that preference will be present in the array, and, as with
|
||||
* getCachedByDomainAndName, its value attribute will be undefined.
|
||||
*
|
||||
* @param domain The preferences' domain.
|
||||
* @param name The preferences' name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param len The length of the returned array.
|
||||
* @param prefs The array of preferences.
|
||||
*/
|
||||
void getCachedBySubdomainAndName(in AString domain,
|
||||
in AString name,
|
||||
in nsILoadContext context,
|
||||
[optional] out unsigned long len,
|
||||
[retval,array,size_is(len)] out nsIContentPref prefs);
|
||||
|
||||
/**
|
||||
* Synchronously retrieves from the in-memory cache the preference with no
|
||||
* domain and the given name.
|
||||
*
|
||||
* As with getCachedByDomainAndName, if the preference is cached then it is
|
||||
* returned; if the preference is known not to exist, then the value attribute
|
||||
* of the returned object will be undefined; if the preference is neither
|
||||
* cached nor known not to exist, then null is returned.
|
||||
*
|
||||
* @param name The preference's name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @return The preference, or null if no such preference is known to
|
||||
* exist.
|
||||
*/
|
||||
nsIContentPref getCachedGlobal(in AString name,
|
||||
in nsILoadContext context);
|
||||
|
||||
/**
|
||||
* Sets a preference.
|
||||
*
|
||||
* @param domain The preference's domain.
|
||||
* @param name The preference's name.
|
||||
* @param value The preference's value.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the preference has been
|
||||
* stored.
|
||||
*/
|
||||
void set(in AString domain,
|
||||
in AString name,
|
||||
in nsIVariant value,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Sets a preference with no domain.
|
||||
*
|
||||
* @param name The preference's name.
|
||||
* @param value The preference's value.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the preference has been
|
||||
* stored.
|
||||
*/
|
||||
void setGlobal(in AString name,
|
||||
in nsIVariant value,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes the preference with the given domain and name.
|
||||
*
|
||||
* @param domain The preference's domain.
|
||||
* @param name The preference's name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeByDomainAndName(in AString domain,
|
||||
in AString name,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes all the preferences with the given name whose domains are either
|
||||
* the same as or subdomains of the given domain.
|
||||
*
|
||||
* @param domain The preferences' domain.
|
||||
* @param name The preferences' name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeBySubdomainAndName(in AString domain,
|
||||
in AString name,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes the preference with no domain and the given name.
|
||||
*
|
||||
* @param name The preference's name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeGlobal(in AString name,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes all preferences with the given domain.
|
||||
*
|
||||
* @param domain The preferences' domain.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeByDomain(in AString domain,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes all preferences whose domains are either the same as or subdomains
|
||||
* of the given domain.
|
||||
*
|
||||
* @param domain The preferences' domain.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeBySubdomain(in AString domain,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes all preferences with the given name regardless of domain, including
|
||||
* global preferences with the given name.
|
||||
*
|
||||
* @param name The preferences' name.
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeByName(in AString name,
|
||||
in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Removes all non-global preferences -- in other words, all preferences that
|
||||
* have a domain.
|
||||
*
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeAllDomains(in nsILoadContext context,
|
||||
[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.
|
||||
*
|
||||
* @param context The private-browsing context, if any.
|
||||
* @param callback handleCompletion is called when the operation completes.
|
||||
*/
|
||||
void removeAllGlobals(in nsILoadContext context,
|
||||
[optional] in nsIContentPrefCallback2 callback);
|
||||
|
||||
/**
|
||||
* Registers an observer that will be notified whenever a preference with the
|
||||
* given name is set or removed.
|
||||
*
|
||||
* When a set or remove method is called, observers are called after the set
|
||||
* or removal completes and after the method's callback is called, and they
|
||||
* are called in the same turn of the event loop as the callback.
|
||||
*
|
||||
* The service holds a strong reference to the observer, so the observer must
|
||||
* be removed later to avoid leaking it.
|
||||
*
|
||||
* @param name The name of the preferences to observe. Pass null to
|
||||
* observe all preference changes regardless of name.
|
||||
* @param observer The observer.
|
||||
*/
|
||||
void addObserverForName(in AString name,
|
||||
in nsIContentPrefObserver observer);
|
||||
|
||||
/**
|
||||
* Unregisters an observer for the given name.
|
||||
*
|
||||
* @param name The name for which the observer was registered. Pass null
|
||||
* if the observer was added with a null name.
|
||||
* @param observer The observer.
|
||||
*/
|
||||
void removeObserverForName(in AString name,
|
||||
in nsIContentPrefObserver observer);
|
||||
|
||||
/**
|
||||
* Extracts and returns the domain from the given string representation of a
|
||||
* URI. This is how the API extracts domains from URIs passed to it.
|
||||
*
|
||||
* @param str The string representation of a URI, like
|
||||
* "http://example.com/foo/bar".
|
||||
* @return If the given string is a valid URI, the domain of that URI is
|
||||
* returned. Otherwise, the string itself is returned.
|
||||
*/
|
||||
AString extractDomain(in AString str);
|
||||
};
|
||||
|
||||
/**
|
||||
* The callback used by the above methods.
|
||||
*/
|
||||
[scriptable, uuid(1a12cf41-79e8-4d0f-9899-2f7b27c5d9a1)]
|
||||
interface nsIContentPrefCallback2 : nsISupports
|
||||
{
|
||||
/**
|
||||
* For the retrieval methods, this is called once for each retrieved
|
||||
* preference. It is not called for other methods.
|
||||
*
|
||||
* @param pref The retrieved preference.
|
||||
*/
|
||||
void handleResult(in nsIContentPref pref);
|
||||
|
||||
/**
|
||||
* Called when an error occurs. This may be called multiple times before
|
||||
* handleCompletion is called.
|
||||
*
|
||||
* @param error A number in Components.results describing the error.
|
||||
*/
|
||||
void handleError(in nsresult error);
|
||||
|
||||
/**
|
||||
* Called when the method finishes. This will be called exactly once for
|
||||
* each method invocation, and afterward no other callback methods will be
|
||||
* called.
|
||||
*
|
||||
* @param reason One of the COMPLETE_* values indicating the manner in which
|
||||
* the method completed.
|
||||
*/
|
||||
void handleCompletion(in unsigned short reason);
|
||||
|
||||
const unsigned short COMPLETE_OK = 0;
|
||||
const unsigned short COMPLETE_ERROR = 1;
|
||||
};
|
||||
|
||||
[scriptable, function, uuid(9f24948d-24b5-4b1b-b554-7dbd58c1d792)]
|
||||
interface nsIContentPref : nsISupports
|
||||
{
|
||||
readonly attribute AString domain;
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIVariant value;
|
||||
};
|
||||
23
dom/interfaces/base/nsIContentURIGrouper.idl
Normal file
23
dom/interfaces/base/nsIContentURIGrouper.idl
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* 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 "nsIURI.idl"
|
||||
|
||||
[scriptable, uuid(4bb38cb4-c3cb-4d17-9799-1b3132b39723)]
|
||||
interface nsIContentURIGrouper : nsISupports
|
||||
{
|
||||
/**
|
||||
* Determine the group to which the URI belongs.
|
||||
*
|
||||
* @param aURI the URI to group
|
||||
*
|
||||
* @returns the group to which the URI belongs
|
||||
*/
|
||||
AString group(in nsIURI aURI);
|
||||
};
|
||||
|
||||
%{C++
|
||||
// The contractID for the generic implementation built in to xpcom.
|
||||
#define NS_HOSTNAME_GROUPER_SERVICE_CONTRACTID "@mozilla.org/content-pref/hostname-grouper;1"
|
||||
%}
|
||||
81
dom/interfaces/base/nsIDOMChromeWindow.idl
Normal file
81
dom/interfaces/base/nsIDOMChromeWindow.idl
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/* -*- 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 nsIBrowserDOMWindow;
|
||||
interface nsIDOMElement;
|
||||
interface nsIDOMEvent;
|
||||
interface nsIMessageBroadcaster;
|
||||
interface mozIDOMWindowProxy;
|
||||
|
||||
[scriptable, uuid(78bdcb41-1efa-409f-aaba-70842213f80f)]
|
||||
interface nsIDOMChromeWindow : nsISupports
|
||||
{
|
||||
const unsigned short STATE_MAXIMIZED = 1;
|
||||
const unsigned short STATE_MINIMIZED = 2;
|
||||
const unsigned short STATE_NORMAL = 3;
|
||||
const unsigned short STATE_FULLSCREEN = 4;
|
||||
|
||||
readonly attribute unsigned short windowState;
|
||||
|
||||
/**
|
||||
* browserDOMWindow provides access to yet another layer of
|
||||
* utility functions implemented by chrome script. It will be null
|
||||
* for DOMWindows not corresponding to browsers.
|
||||
*/
|
||||
attribute nsIBrowserDOMWindow browserDOMWindow;
|
||||
|
||||
void getAttention();
|
||||
|
||||
void getAttentionWithCycleCount(in long aCycleCount);
|
||||
|
||||
void setCursor(in DOMString cursor);
|
||||
|
||||
void maximize();
|
||||
void minimize();
|
||||
void restore();
|
||||
|
||||
/**
|
||||
* Notify a default button is loaded on a dialog or a wizard.
|
||||
* defaultButton is the default button.
|
||||
*/
|
||||
void notifyDefaultButtonLoaded(in nsIDOMElement defaultButton);
|
||||
|
||||
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
|
||||
* while the left mouse button is held down, callers must check this.
|
||||
*
|
||||
* The optional panel argument should be set when moving a panel.
|
||||
*
|
||||
* Returns NS_ERROR_NOT_IMPLEMENTED (and thus throws in JS) if the OS
|
||||
* doesn't support this.
|
||||
*/
|
||||
void beginWindowMove(in nsIDOMEvent mouseDownEvent, [optional] in nsIDOMElement panel);
|
||||
|
||||
/**
|
||||
* These methods provide a way to specify the opener value for the content in
|
||||
* the window before the content itself is created. This is important in order
|
||||
* to set the DocGroup of a document, as the opener must be set before the
|
||||
* document is created.
|
||||
*
|
||||
* SetOpenerForInitialContentBrowser is used to set which opener will be used,
|
||||
* and TakeOpenerForInitialContentBrowser is used by nsXULElement in order to
|
||||
* take the value set earlier, and null out the value in the
|
||||
* nsIDOMChromeWindow.
|
||||
*/
|
||||
void setOpenerForInitialContentBrowser(in mozIDOMWindowProxy aOpener);
|
||||
mozIDOMWindowProxy takeOpenerForInitialContentBrowser();
|
||||
};
|
||||
17
dom/interfaces/base/nsIDOMClientRect.idl
Normal file
17
dom/interfaces/base/nsIDOMClientRect.idl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- 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"
|
||||
|
||||
[uuid(B2F824C4-D9D3-499B-8D3B-45C8245497C6)]
|
||||
interface nsIDOMClientRect : nsISupports
|
||||
{
|
||||
readonly attribute float left;
|
||||
readonly attribute float top;
|
||||
readonly attribute float right;
|
||||
readonly attribute float bottom;
|
||||
readonly attribute float width;
|
||||
readonly attribute float height;
|
||||
};
|
||||
13
dom/interfaces/base/nsIDOMClientRectList.idl
Normal file
13
dom/interfaces/base/nsIDOMClientRectList.idl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* -*- 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"
|
||||
|
||||
[uuid(f474c567-cbcb-458f-abad-ae42363da287)]
|
||||
interface nsIDOMClientRectList : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long length;
|
||||
nsIDOMClientRect item(in unsigned long index);
|
||||
};
|
||||
13
dom/interfaces/base/nsIDOMConstructor.idl
Normal file
13
dom/interfaces/base/nsIDOMConstructor.idl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 sw=2 et tw=80: */
|
||||
/* 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(0ccbcf19-d1b4-489e-984c-cd8c43672bb9)]
|
||||
interface nsIDOMDOMConstructor : nsISupports
|
||||
{
|
||||
AString toString();
|
||||
};
|
||||
|
||||
14
dom/interfaces/base/nsIDOMCrypto.idl
Normal file
14
dom/interfaces/base/nsIDOMCrypto.idl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- 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 nsIGlobalObject;
|
||||
|
||||
[uuid(48d7f7fd-bb85-4c04-9b8b-5cd9131acdef)]
|
||||
interface nsIDOMCrypto : nsISupports
|
||||
{
|
||||
[notxpcom] void init(in nsIGlobalObject parent);
|
||||
};
|
||||
21
dom/interfaces/base/nsIDOMGlobalPropertyInitializer.idl
Normal file
21
dom/interfaces/base/nsIDOMGlobalPropertyInitializer.idl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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 mozIDOMWindow;
|
||||
|
||||
[scriptable, uuid(5842e275-797f-4afb-b7e0-e29f0cb312ae)]
|
||||
interface nsIDOMGlobalPropertyInitializer : nsISupports
|
||||
{
|
||||
/*
|
||||
* Initialize the global property.
|
||||
*
|
||||
* @param window the global object on which the property is being retrieved.
|
||||
*
|
||||
* @returns a JS Object to use use as the property's value.
|
||||
*/
|
||||
jsval init(in mozIDOMWindow window);
|
||||
};
|
||||
12
dom/interfaces/base/nsIDOMHistory.idl
Normal file
12
dom/interfaces/base/nsIDOMHistory.idl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* -*- 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"
|
||||
|
||||
[uuid(55226663-fe68-48ba-addf-08e32eaab569)]
|
||||
interface nsIDOMHistory : nsISupports
|
||||
{
|
||||
// Empty interface that exists only for extension backwards compat
|
||||
};
|
||||
33
dom/interfaces/base/nsIDOMLocation.idl
Normal file
33
dom/interfaces/base/nsIDOMLocation.idl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
[scriptable, uuid(79de76e5-994e-4f6b-81aa-42d9adb6e67e)]
|
||||
interface nsIDOMLocation : nsISupports
|
||||
{
|
||||
/**
|
||||
* These properties refer to the current location of the document.
|
||||
* This will correspond to the URI shown in the location bar, which
|
||||
* can be different from the documentURI of the document.
|
||||
*/
|
||||
attribute DOMString hash;
|
||||
attribute DOMString host;
|
||||
attribute DOMString hostname;
|
||||
attribute DOMString href;
|
||||
attribute DOMString pathname;
|
||||
attribute DOMString port;
|
||||
attribute DOMString protocol;
|
||||
attribute DOMString search;
|
||||
|
||||
readonly attribute DOMString origin;
|
||||
|
||||
void reload([optional] in boolean forceget);
|
||||
void replace(in DOMString url);
|
||||
void assign(in DOMString url);
|
||||
|
||||
DOMString toString();
|
||||
nsIDOMLocation valueOf();
|
||||
};
|
||||
26
dom/interfaces/base/nsIDOMModalContentWindow.idl
Normal file
26
dom/interfaces/base/nsIDOMModalContentWindow.idl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* -*- 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 nsIVariant;
|
||||
interface nsIArray;
|
||||
|
||||
[scriptable, uuid(3f4cb2d0-5f7e-44a9-9f4f-370945f8db08)]
|
||||
interface nsIDOMModalContentWindow : nsISupports
|
||||
{
|
||||
/**
|
||||
* Readonly attribute containing an arbitrary JS value passed by the
|
||||
* code that opened the modal content window. A security check is
|
||||
* performed at access time, per spec.
|
||||
*/
|
||||
readonly attribute nsIVariant dialogArguments;
|
||||
|
||||
/**
|
||||
* The return value that will be returned to the function that
|
||||
* opened the modal content window.
|
||||
*/
|
||||
attribute nsIVariant returnValue;
|
||||
};
|
||||
26
dom/interfaces/base/nsIDOMNavigator.idl
Normal file
26
dom/interfaces/base/nsIDOMNavigator.idl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* -*- 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 nsIIdleObserver;
|
||||
|
||||
[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 DOMString platform;
|
||||
readonly attribute DOMString oscpu;
|
||||
readonly attribute DOMString vendor;
|
||||
readonly attribute DOMString vendorSub;
|
||||
readonly attribute DOMString product;
|
||||
readonly attribute DOMString productSub;
|
||||
readonly attribute DOMString userAgent;
|
||||
readonly attribute DOMString buildID;
|
||||
readonly attribute DOMString doNotTrack;
|
||||
};
|
||||
29
dom/interfaces/base/nsIDOMScreen.idl
Normal file
29
dom/interfaces/base/nsIDOMScreen.idl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- 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 "nsIDOMEventTarget.idl"
|
||||
|
||||
[builtinclass, uuid(82c7924b-4b46-4e5a-a8d2-6edb5fc0a60d)]
|
||||
interface nsIDOMScreen : nsIDOMEventTarget
|
||||
{
|
||||
readonly attribute long top;
|
||||
readonly attribute long left;
|
||||
readonly attribute long width;
|
||||
readonly attribute long height;
|
||||
readonly attribute long pixelDepth;
|
||||
readonly attribute long colorDepth;
|
||||
readonly attribute long availWidth;
|
||||
readonly attribute long availHeight;
|
||||
readonly attribute long availLeft;
|
||||
readonly attribute long availTop;
|
||||
|
||||
/**
|
||||
* Returns the current screen orientation.
|
||||
* Can be: landscape-primary, landscape-secondary,
|
||||
* portrait-primary or portrait-secondary.
|
||||
*/
|
||||
[binaryname(SlowMozOrientation)]
|
||||
readonly attribute DOMString mozOrientation;
|
||||
};
|
||||
30
dom/interfaces/base/nsIDOMWindow.idl
Normal file
30
dom/interfaces/base/nsIDOMWindow.idl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* -*- 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 nsIControllers;
|
||||
interface nsIDOMBlob;
|
||||
interface nsIDOMLocation;
|
||||
interface nsIDOMOfflineResourceList;
|
||||
interface nsIPrompt;
|
||||
interface nsISelection;
|
||||
interface nsIVariant;
|
||||
|
||||
/**
|
||||
* Empty interface for compatibility with older versions.
|
||||
* @deprecated Use WebIDL for script visible features,
|
||||
* nsPIDOMWindow for C++ callers.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(b8343993-0383-4add-9930-ad176b189240)]
|
||||
interface nsIDOMWindow : nsISupports {};
|
||||
|
||||
/**
|
||||
* Empty interface for compatibility with older versions.
|
||||
* @deprecated Use nsIDOMWindow instead
|
||||
*/
|
||||
[scriptable, uuid(8c589e65-3237-4cd1-8bad-c5c47135e79b)]
|
||||
interface nsIDOMWindowInternal : nsIDOMWindow {};
|
||||
32
dom/interfaces/base/nsIDOMWindowCollection.idl
Normal file
32
dom/interfaces/base/nsIDOMWindowCollection.idl
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/* -*- 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 mozIDOMWindowProxy;
|
||||
|
||||
/**
|
||||
* The nsIDOMWindowCollection interface is an interface for a
|
||||
* collection of DOM window objects.
|
||||
*/
|
||||
|
||||
[uuid(8d64f457-fb8c-49ea-a359-cef30eed9774)]
|
||||
interface nsIDOMWindowCollection : nsISupports
|
||||
{
|
||||
/**
|
||||
* Accessor for the number of windows in this collection.
|
||||
*/
|
||||
readonly attribute unsigned long length;
|
||||
|
||||
/**
|
||||
* Method for accessing an item in this collection by index.
|
||||
*/
|
||||
mozIDOMWindowProxy item(in unsigned long index);
|
||||
|
||||
/**
|
||||
* Method for accessing an item in this collection by window name.
|
||||
*/
|
||||
mozIDOMWindowProxy namedItem(in DOMString name);
|
||||
};
|
||||
2009
dom/interfaces/base/nsIDOMWindowUtils.idl
Normal file
2009
dom/interfaces/base/nsIDOMWindowUtils.idl
Normal file
File diff suppressed because it is too large
Load diff
276
dom/interfaces/base/nsIFocusManager.idl
Normal file
276
dom/interfaces/base/nsIFocusManager.idl
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/* -*- 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 mozIDOMWindowProxy;
|
||||
interface nsIDocument;
|
||||
interface nsIContent;
|
||||
|
||||
[scriptable, uuid(86e1f1e1-365d-493b-b52a-a649f3f311dc)]
|
||||
/**
|
||||
* 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
|
||||
* receives any keyboard events. While there is only one application-wide
|
||||
* focused element, each nsIDOMWindow maintains a reference to the element
|
||||
* that would be focused if the window was active.
|
||||
*
|
||||
* If the window's reference is to a frame element (iframe, browser,
|
||||
* editor), then the child window contains the element that is currently
|
||||
* focused. If the window's reference is to a root element, then the root is
|
||||
* focused. If a window's reference is null, then no element is focused, yet
|
||||
* the window is still focused.
|
||||
*
|
||||
* The blur event is fired on an element when it loses the application focus.
|
||||
* After this blur event, if the focus is moving away from a document, two
|
||||
* additional blur events are fired on the old document and window containing
|
||||
* the focus respectively.
|
||||
*
|
||||
* When a new document is focused, two focus events are fired on the new
|
||||
* document and window respectively. Then the focus event is fired on an
|
||||
* element when it gains the application focus.
|
||||
*
|
||||
* A special case is that the root element may be focused, yet does not
|
||||
* receive the element focus and blur events. Instead a focus outline may be
|
||||
* drawn around the document.
|
||||
*
|
||||
* Blur and focus events do not bubble as per the W3C DOM Events spec.
|
||||
*/
|
||||
interface nsIFocusManager : nsISupports
|
||||
{
|
||||
/**
|
||||
* The most active (frontmost) window, or null if no window that is part of
|
||||
* the application is active. Setting the activeWindow raises it, and
|
||||
* focuses the current child window's current element, if any. Setting this
|
||||
* to null or to a non-top-level window throws an NS_ERROR_INVALID_ARG
|
||||
* exception.
|
||||
*/
|
||||
attribute mozIDOMWindowProxy activeWindow;
|
||||
|
||||
/**
|
||||
* The child window within the activeWindow that is focused. This will
|
||||
* always be activeWindow, a child window of activeWindow or null if no
|
||||
* child window is focused. Setting the focusedWindow changes the focused
|
||||
* window and raises the toplevel window it is in. If the current focus
|
||||
* within the new focusedWindow is a frame element, then the focusedWindow
|
||||
* will actually be set to the child window and the current element within
|
||||
* that set as the focused element. This process repeats downwards until a
|
||||
* non-frame element is found.
|
||||
*/
|
||||
attribute mozIDOMWindowProxy focusedWindow;
|
||||
|
||||
/**
|
||||
* The element that is currently focused. This will always be an element
|
||||
* within the document loaded in focusedWindow or null if no element in that
|
||||
* document is focused.
|
||||
*/
|
||||
readonly attribute nsIDOMElement focusedElement;
|
||||
|
||||
/**
|
||||
* Returns the method that was used to focus the element in window. This
|
||||
* will either be 0, FLAG_BYMOUSE or FLAG_BYKEY. If window is null, then
|
||||
* the current focusedWindow will be used by default. This has the result
|
||||
* of retrieving the method that was used to focus the currently focused
|
||||
* element.
|
||||
*/
|
||||
uint32_t getLastFocusMethod(in mozIDOMWindowProxy window);
|
||||
|
||||
/**
|
||||
* Changes the focused element reference within the window containing
|
||||
* aElement to aElement.
|
||||
*/
|
||||
void setFocus(in nsIDOMElement aElement, in unsigned long aFlags);
|
||||
|
||||
/**
|
||||
* Move the focus to another element. If aStartElement is specified, then
|
||||
* movement is done relative to aStartElement. If aStartElement is null,
|
||||
* then movement is done relative to the currently focused element. If no
|
||||
* element is focused, focus the first focusable element within the
|
||||
* document (or the last focusable element if aType is MOVEFOCUS_END). This
|
||||
* method is equivalent to setting the focusedElement to the new element.
|
||||
*
|
||||
* Specifying aStartElement and using MOVEFOCUS_LAST is not currently
|
||||
* implemented.
|
||||
*
|
||||
* If no element is found, and aType is either MOVEFOCUS_ROOT or
|
||||
* MOVEFOCUS_CARET, then the focus is cleared. If aType is any other value,
|
||||
* the focus is not changed.
|
||||
*
|
||||
* Returns the element that was focused. The return value may be null if focus
|
||||
* was moved into a child process.
|
||||
*/
|
||||
nsIDOMElement moveFocus(in mozIDOMWindowProxy aWindow,
|
||||
in nsIDOMElement aStartElement,
|
||||
in unsigned long aType, in unsigned long aFlags);
|
||||
|
||||
/**
|
||||
* Clears the focused element within aWindow. If the current focusedWindow
|
||||
* is a descendant of aWindow, sets the current focusedWindow to aWindow.
|
||||
*
|
||||
* @throws NS_ERROR_INVALID_ARG if aWindow is null
|
||||
*/
|
||||
void clearFocus(in mozIDOMWindowProxy aWindow);
|
||||
|
||||
/**
|
||||
* Returns the currently focused element within aWindow. If aWindow is equal
|
||||
* to the current value of focusedWindow, then the returned element will be
|
||||
* the application-wide focused element (the value of focusedElement). The
|
||||
* return value will be null if no element is focused.
|
||||
*
|
||||
* If aDeep is true, then child frames are traversed and the return value
|
||||
* may be the element within a child descendant window that is focused. If
|
||||
* aDeep if false, then the return value will be the frame element if the
|
||||
* focus is in a child frame.
|
||||
*
|
||||
* aFocusedWindow will be set to the currently focused descendant window of
|
||||
* aWindow, or to aWindow if aDeep is false. This will be set even if no
|
||||
* element is focused.
|
||||
*
|
||||
* @throws NS_ERROR_INVALID_ARG if aWindow is null
|
||||
*/
|
||||
nsIDOMElement getFocusedElementForWindow(in mozIDOMWindowProxy aWindow,
|
||||
in boolean aDeep,
|
||||
out mozIDOMWindowProxy aFocusedWindow);
|
||||
|
||||
/**
|
||||
* Moves the selection caret within aWindow to the current focus.
|
||||
*/
|
||||
void moveCaretToFocus(in mozIDOMWindowProxy aWindow);
|
||||
|
||||
/***
|
||||
* Check if given element is focusable.
|
||||
*/
|
||||
boolean elementIsFocusable(in nsIDOMElement aElement, in unsigned long aFlags);
|
||||
|
||||
/*
|
||||
* Raise the window when switching focus
|
||||
*/
|
||||
const unsigned long FLAG_RAISE = 1;
|
||||
|
||||
/**
|
||||
* Do not scroll the element to focus into view
|
||||
*/
|
||||
const unsigned long FLAG_NOSCROLL = 2;
|
||||
|
||||
/**
|
||||
* If attempting to change focus in a window that is not focused, do not
|
||||
* switch focus to that window. Instead, just update the focus within that
|
||||
* window and leave the application focus as is. This flag will have no
|
||||
* effect if a child window is focused and an attempt is made to adjust the
|
||||
* focus in an ancestor, as the frame must be switched in this case.
|
||||
*/
|
||||
const unsigned long FLAG_NOSWITCHFRAME = 4;
|
||||
|
||||
/**
|
||||
* This flag is only used when passed to moveFocus. If set, focus is never
|
||||
* moved to the parent frame of the starting element's document, instead
|
||||
* iterating around to the beginning of that document again. Child frames
|
||||
* are navigated as normal.
|
||||
*/
|
||||
const unsigned long FLAG_NOPARENTFRAME = 8;
|
||||
|
||||
/**
|
||||
* Focus is changing due to a mouse operation, for instance the mouse was
|
||||
* clicked on an element.
|
||||
*/
|
||||
const unsigned long FLAG_BYMOUSE = 0x1000;
|
||||
|
||||
/**
|
||||
* Focus is changing due to a key operation, for instance pressing the tab
|
||||
* key. This flag would normally be passed when MOVEFOCUS_FORWARD or
|
||||
* MOVEFOCUS_BACKWARD is used.
|
||||
*/
|
||||
const unsigned long FLAG_BYKEY = 0x2000;
|
||||
|
||||
/**
|
||||
* Focus is changing due to a call to MoveFocus. This flag will be implied
|
||||
* when MoveFocus is called except when one of the other mechanisms (mouse
|
||||
* or key) is specified, or when the type is MOVEFOCUS_ROOT or
|
||||
* MOVEFOCUS_CARET.
|
||||
*/
|
||||
const unsigned long FLAG_BYMOVEFOCUS = 0x4000;
|
||||
|
||||
/**
|
||||
* Always show the focus ring or other indicator of focus, regardless of
|
||||
* other state.
|
||||
*/
|
||||
const unsigned long FLAG_SHOWRING = 0x100000;
|
||||
|
||||
/**
|
||||
* Focus is changing due to a touch operation that generated a mouse event.
|
||||
* Normally used in conjunction with FLAG_BYMOUSE.
|
||||
*/
|
||||
const unsigned long FLAG_BYTOUCH = 0x200000;
|
||||
|
||||
// these constants are used with the aType argument to MoveFocus
|
||||
|
||||
/** move focus forward one element, used when pressing TAB */
|
||||
const unsigned long MOVEFOCUS_FORWARD = 1;
|
||||
/** move focus backward one element, used when pressing Shift+TAB */
|
||||
const unsigned long MOVEFOCUS_BACKWARD = 2;
|
||||
/** move focus forward to the next frame document, used when pressing F6 */
|
||||
const unsigned long MOVEFOCUS_FORWARDDOC = 3;
|
||||
/** move focus forward to the previous frame document, used when pressing Shift+F6 */
|
||||
const unsigned long MOVEFOCUS_BACKWARDDOC = 4;
|
||||
/** move focus to the first focusable element */
|
||||
const unsigned long MOVEFOCUS_FIRST = 5;
|
||||
/** move focus to the last focusable element */
|
||||
const unsigned long MOVEFOCUS_LAST = 6;
|
||||
/** move focus to the root element in the document */
|
||||
const unsigned long MOVEFOCUS_ROOT = 7;
|
||||
/** move focus to a link at the position of the caret. This is a special value used to
|
||||
* focus links as the caret moves over them in caret browsing mode.
|
||||
*/
|
||||
const unsigned long MOVEFOCUS_CARET = 8;
|
||||
|
||||
/** move focus to the first focusable document */
|
||||
const unsigned long MOVEFOCUS_FIRSTDOC = 9;
|
||||
/** move focus to the last focusable document */
|
||||
const unsigned long MOVEFOCUS_LASTDOC = 10;
|
||||
|
||||
/**
|
||||
* Called when a window has been raised.
|
||||
*/
|
||||
[noscript] void windowRaised(in mozIDOMWindowProxy aWindow);
|
||||
|
||||
/**
|
||||
* Called when a window has been lowered.
|
||||
*/
|
||||
[noscript] void windowLowered(in mozIDOMWindowProxy aWindow);
|
||||
|
||||
/**
|
||||
* Called when a new document in a window is shown.
|
||||
*
|
||||
* If aNeedsFocus is true, then focus events are expected to be fired on the
|
||||
* window if this window is in the focused window chain.
|
||||
*/
|
||||
[noscript] void windowShown(in mozIDOMWindowProxy aWindow,
|
||||
in boolean aNeedsFocus);
|
||||
|
||||
/**
|
||||
* Called when a document in a window has been hidden or otherwise can no
|
||||
* longer accept focus.
|
||||
*/
|
||||
[noscript] void windowHidden(in mozIDOMWindowProxy aWindow);
|
||||
|
||||
/**
|
||||
* Fire any events that have been delayed due to synchronized actions.
|
||||
*/
|
||||
[noscript] void fireDelayedEvents(in nsIDocument aDocument);
|
||||
|
||||
/**
|
||||
* Indicate that a plugin wishes to take the focus. This is similar to a
|
||||
* normal focus except that the widget focus is not changed. Updating the
|
||||
* 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 mozIDOMWindowProxy aWindow,
|
||||
in bool active);
|
||||
};
|
||||
16
dom/interfaces/base/nsIIdleObserver.idl
Normal file
16
dom/interfaces/base/nsIIdleObserver.idl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* -*- 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(37916e05-e062-4f72-96d5-660cfb55e9b6)]
|
||||
interface nsIIdleObserver : nsISupports
|
||||
{
|
||||
// Time is in seconds and is read only when idle observers are added
|
||||
// and removed.
|
||||
readonly attribute unsigned long time;
|
||||
void onidle();
|
||||
void onactive();
|
||||
};
|
||||
34
dom/interfaces/base/nsIQueryContentEventResult.idl
Normal file
34
dom/interfaces/base/nsIQueryContentEventResult.idl
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The result of query content events. succeeded propery can be used always.
|
||||
* Whether other properties can be used or not depends on the event.
|
||||
* See nsIDOMWindowUtils.idl, which properites can be used was documented.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(e2c39e0e-345f-451a-a7b2-e0230d555847)]
|
||||
interface nsIQueryContentEventResult : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long offset;
|
||||
readonly attribute unsigned long tentativeCaretOffset;
|
||||
readonly attribute boolean reversed;
|
||||
|
||||
readonly attribute long left;
|
||||
readonly attribute long top;
|
||||
readonly attribute long width;
|
||||
readonly attribute long height;
|
||||
readonly attribute AString text;
|
||||
|
||||
void getCharacterRect(in long offset,
|
||||
out long left, out long top,
|
||||
out long width, out long height);
|
||||
|
||||
readonly attribute boolean succeeded;
|
||||
readonly attribute boolean notFound;
|
||||
readonly attribute boolean tentativeCaretOffsetNotFound;
|
||||
};
|
||||
25
dom/interfaces/base/nsIRemoteBrowser.idl
Normal file
25
dom/interfaces/base/nsIRemoteBrowser.idl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* 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);
|
||||
};
|
||||
227
dom/interfaces/base/nsIServiceWorkerManager.idl
Normal file
227
dom/interfaces/base/nsIServiceWorkerManager.idl
Normal file
|
|
@ -0,0 +1,227 @@
|
|||
/* -*- 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 mozIDOMWindow;
|
||||
interface nsPIDOMWindowInner;
|
||||
interface mozIDOMWindowProxy;
|
||||
interface nsIArray;
|
||||
interface nsIDocument;
|
||||
interface nsIInterceptedChannel;
|
||||
interface nsIPrincipal;
|
||||
interface nsIRunnable;
|
||||
interface nsIURI;
|
||||
|
||||
[scriptable, uuid(52ee2c9d-ee87-4caf-9588-23ae77ff8798)]
|
||||
interface nsIServiceWorkerUnregisterCallback : nsISupports
|
||||
{
|
||||
// aState is true if the unregistration succeded.
|
||||
// It's false if this ServiceWorkerRegistration doesn't exist.
|
||||
void unregisterSucceeded(in bool aState);
|
||||
void unregisterFailed();
|
||||
};
|
||||
|
||||
interface nsIWorkerDebugger;
|
||||
|
||||
[scriptable, builtinclass, uuid(76e357ed-208d-4e4c-9165-1c4059707879)]
|
||||
interface nsIServiceWorkerInfo : nsISupports
|
||||
{
|
||||
// State values below should match the ServiceWorkerState enumeration.
|
||||
const unsigned short STATE_INSTALLING = 0;
|
||||
const unsigned short STATE_INSTALLED = 1;
|
||||
const unsigned short STATE_ACTIVATING = 2;
|
||||
const unsigned short STATE_ACTIVATED = 3;
|
||||
const unsigned short STATE_REDUNDANT = 4;
|
||||
const unsigned short STATE_UNKNOWN = 5;
|
||||
|
||||
readonly attribute DOMString scriptSpec;
|
||||
readonly attribute DOMString cacheName;
|
||||
|
||||
readonly attribute unsigned short state;
|
||||
|
||||
readonly attribute nsIWorkerDebugger debugger;
|
||||
|
||||
void attachDebugger();
|
||||
|
||||
void detachDebugger();
|
||||
};
|
||||
|
||||
[scriptable, uuid(87e63548-d440-4b8a-b158-65ad1de0211E)]
|
||||
interface nsIServiceWorkerRegistrationInfoListener : nsISupports
|
||||
{
|
||||
void onChange();
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(ddbc1fd4-2f2e-4fca-a395-6e010bbedfe3)]
|
||||
interface nsIServiceWorkerRegistrationInfo : nsISupports
|
||||
{
|
||||
readonly attribute nsIPrincipal principal;
|
||||
|
||||
readonly attribute DOMString scope;
|
||||
readonly attribute DOMString scriptSpec;
|
||||
|
||||
readonly attribute nsIServiceWorkerInfo installingWorker;
|
||||
readonly attribute nsIServiceWorkerInfo waitingWorker;
|
||||
readonly attribute nsIServiceWorkerInfo activeWorker;
|
||||
|
||||
// Allows to get the related nsIServiceWorkerInfo for a given
|
||||
// nsIWorkerDebugger. Over time we shouldn't need this anymore,
|
||||
// and instead always control then nsIWorkerDebugger from
|
||||
// nsIServiceWorkerInfo and not the other way around. Returns
|
||||
// null if the service worker is no longer registered.
|
||||
nsIServiceWorkerInfo getWorkerByID(in unsigned long long aID);
|
||||
|
||||
void addListener(in nsIServiceWorkerRegistrationInfoListener listener);
|
||||
|
||||
void removeListener(in nsIServiceWorkerRegistrationInfoListener listener);
|
||||
};
|
||||
|
||||
[scriptable, uuid(9e523e7c-ad6f-4df0-8077-c74aebbc679d)]
|
||||
interface nsIServiceWorkerManagerListener : nsISupports
|
||||
{
|
||||
void onRegister(in nsIServiceWorkerRegistrationInfo aInfo);
|
||||
|
||||
void onUnregister(in nsIServiceWorkerRegistrationInfo aInfo);
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(7404c8e8-4d47-4449-8ed1-47d1261d4e33)]
|
||||
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 mozIDOMWindow aWindow, in nsIURI aScope, in nsIURI 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 mozIDOMWindow aWindow);
|
||||
|
||||
// Returns a Promise
|
||||
nsISupports getRegistration(in mozIDOMWindow aWindow, in DOMString aScope);
|
||||
|
||||
// Returns a Promise
|
||||
nsISupports getReadyPromise(in mozIDOMWindow aWindow);
|
||||
|
||||
// Remove ready pending Promise
|
||||
void removeReadyPromise(in mozIDOMWindow aWindow);
|
||||
|
||||
nsIServiceWorkerRegistrationInfo getRegistrationByPrincipal(in nsIPrincipal aPrincipal,
|
||||
in DOMString aScope);
|
||||
|
||||
/**
|
||||
* 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, in DOMString aDocumentId);
|
||||
|
||||
/**
|
||||
* 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 nsPIDOMWindowInner aWindow, in DOMString aScope);
|
||||
[noscript] nsISupports GetWaiting(in nsPIDOMWindowInner aWindow, in DOMString aScope);
|
||||
[noscript] nsISupports GetActive(in nsPIDOMWindowInner aWindow, in DOMString aScope);
|
||||
|
||||
/*
|
||||
* Returns a ServiceWorker object representing the active worker controlling this
|
||||
* window.
|
||||
*/
|
||||
[noscript] nsISupports GetDocumentController(in nsPIDOMWindowInner aWindow);
|
||||
|
||||
/*
|
||||
* Clears ServiceWorker registrations from memory and disk for the specified
|
||||
* host.
|
||||
* - All ServiceWorker instances change their state to redundant.
|
||||
* - Existing ServiceWorker instances handling fetches will keep running.
|
||||
* - All documents will immediately stop being controlled.
|
||||
* - Unregister jobs will be queued for all registrations.
|
||||
* This eventually results in the registration being deleted from disk too.
|
||||
*/
|
||||
void removeAndPropagate(in AUTF8String aHost);
|
||||
|
||||
// Testing
|
||||
DOMString getScopeForUrl(in nsIPrincipal aPrincipal, in DOMString aPath);
|
||||
|
||||
// Note: This is meant to be used only by about:serviceworkers.
|
||||
// It returns an array of nsIServiceWorkerRegistrationInfos.
|
||||
nsIArray getAllRegistrations();
|
||||
|
||||
// Note: This is meant to be used only by about:serviceworkers.
|
||||
// It calls softUpdate() for each child process.
|
||||
[implicit_jscontext] void propagateSoftUpdate(in jsval aOriginAttributes,
|
||||
in DOMString aScope);
|
||||
|
||||
// Note: This is meant to be used only by about:serviceworkers.
|
||||
// It calls unregister() in each child process. The callback is used to
|
||||
// inform when unregister() is completed on the current process.
|
||||
void propagateUnregister(in nsIPrincipal aPrincipal,
|
||||
in nsIServiceWorkerUnregisterCallback aCallback,
|
||||
in DOMString aScope);
|
||||
|
||||
void sendNotificationClickEvent(in ACString aOriginSuffix,
|
||||
in ACString scope,
|
||||
in AString aID,
|
||||
in AString aTitle,
|
||||
in AString aDir,
|
||||
in AString aLang,
|
||||
in AString aBody,
|
||||
in AString aTag,
|
||||
in AString aIcon,
|
||||
in AString aData,
|
||||
in AString aBehavior);
|
||||
|
||||
void sendNotificationCloseEvent(in ACString aOriginSuffix,
|
||||
in ACString scope,
|
||||
in AString aID,
|
||||
in AString aTitle,
|
||||
in AString aDir,
|
||||
in AString aLang,
|
||||
in AString aBody,
|
||||
in AString aTag,
|
||||
in AString aIcon,
|
||||
in AString aData,
|
||||
in AString aBehavior);
|
||||
|
||||
[optional_argc] void sendPushEvent(in ACString aOriginAttributes,
|
||||
in ACString aScope,
|
||||
[optional] in uint32_t aDataLength,
|
||||
[optional, array, size_is(aDataLength)] in uint8_t aDataBytes);
|
||||
void sendPushSubscriptionChangeEvent(in ACString aOriginAttributes,
|
||||
in ACString scope);
|
||||
|
||||
void addListener(in nsIServiceWorkerManagerListener aListener);
|
||||
|
||||
void removeListener(in nsIServiceWorkerManagerListener aListener);
|
||||
|
||||
bool shouldReportToWindow(in mozIDOMWindowProxy aWindow, in ACString aScope);
|
||||
};
|
||||
|
||||
%{ C++
|
||||
#define SERVICEWORKERMANAGER_CONTRACTID "@mozilla.org/serviceworkers/manager;1"
|
||||
%}
|
||||
77
dom/interfaces/base/nsIStructuredCloneContainer.idl
Normal file
77
dom/interfaces/base/nsIStructuredCloneContainer.idl
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: set ts=8 sw=2 et tw=80:
|
||||
*
|
||||
* 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 nsIVariant;
|
||||
interface nsIDocument;
|
||||
|
||||
%{C++
|
||||
#include "js/TypeDecls.h"
|
||||
%}
|
||||
|
||||
/**
|
||||
* This interface acts as a container for an object serialized using the
|
||||
* structured clone algorithm.
|
||||
*
|
||||
* You can copy an object into an nsIStructuredCloneContainer using
|
||||
* 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
|
||||
* stores by calling deserializeToVariant. You can also get a base-64-encoded
|
||||
* string containing a copy of the container's serialized data, using
|
||||
* getDataAsBase64.
|
||||
*/
|
||||
[scriptable, uuid(c664aae7-0d67-4155-a2dd-a3861778626f)]
|
||||
interface nsIStructuredCloneContainer : nsISupports
|
||||
{
|
||||
/**
|
||||
* Initialize this structured clone container so it contains a clone of the
|
||||
* given jsval.
|
||||
*/
|
||||
[noscript, implicit_jscontext]
|
||||
void initFromJSVal(in jsval aData);
|
||||
|
||||
/**
|
||||
* Initialize this structured clone container from a base-64-encoded byte
|
||||
* stream, stored in aData. aFormatVersion should be the version of the
|
||||
* structured clone algorithm which was used to generate aData.
|
||||
*/
|
||||
void initFromBase64(in AString aData, in unsigned long aFormatVersion);
|
||||
|
||||
/**
|
||||
* Deserializes this structured clone container returning it as a jsval.
|
||||
* Can be called on main and worker threads.
|
||||
*/
|
||||
[implicit_jscontext]
|
||||
jsval deserializeToJsval();
|
||||
|
||||
/**
|
||||
* Deserialize the object this container holds, returning it wrapped as
|
||||
* an nsIVariant.
|
||||
* Main thread only!
|
||||
*/
|
||||
[implicit_jscontext]
|
||||
nsIVariant deserializeToVariant();
|
||||
|
||||
/**
|
||||
* Get this structured clone container's data as a base-64-encoded string.
|
||||
*/
|
||||
AString getDataAsBase64();
|
||||
|
||||
/**
|
||||
* Get the size in bytes of this container's serialized data.
|
||||
*/
|
||||
readonly attribute unsigned long long serializedNBytes;
|
||||
|
||||
/**
|
||||
* Get the version of the structured clone algorithm which was used to
|
||||
* generate this container's serialized buffer.
|
||||
*/
|
||||
readonly attribute unsigned long formatVersion;
|
||||
};
|
||||
38
dom/interfaces/base/nsITabChild.idl
Normal file
38
dom/interfaces/base/nsITabChild.idl
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* 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"
|
||||
#include "nsIDroppedLinkHandler.idl"
|
||||
|
||||
interface nsIContentFrameMessageManager;
|
||||
interface nsIWebBrowserChrome3;
|
||||
|
||||
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);
|
||||
|
||||
[notxpcom] void sendGetTabCount(out uint32_t tabCount);
|
||||
|
||||
[noscript, notxpcom] void enableDisableCommands(in AString action,
|
||||
in CommandsArrayRef enabledCommands,
|
||||
in CommandsArrayRef disabledCommands);
|
||||
|
||||
[noscript] void remoteSizeShellTo(in int32_t width, in int32_t height,
|
||||
in int32_t shellItemWidth, in int32_t shellItemHeight);
|
||||
|
||||
[noscript] void remoteDropLinks(in unsigned long linksCount,
|
||||
[array, size_is(linksCount)] in nsIDroppedLinkItem links);
|
||||
|
||||
readonly attribute uint64_t tabId;
|
||||
};
|
||||
|
||||
59
dom/interfaces/base/nsITabParent.idl
Normal file
59
dom/interfaces/base/nsITabParent.idl
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/* 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"
|
||||
|
||||
[builtinclass, scriptable, uuid(8e49f7b0-1f98-4939-bf91-e9c39cd56434)]
|
||||
interface nsITabParent : nsISupports
|
||||
{
|
||||
void getChildProcessOffset(out int32_t aCssX, out int32_t aCssY);
|
||||
|
||||
readonly attribute boolean useAsyncPanZoom;
|
||||
|
||||
/**
|
||||
* Manages the docshell active state of the remote browser.
|
||||
*/
|
||||
attribute boolean docShellIsActive;
|
||||
|
||||
/**
|
||||
* Whether this tabParent is in prerender mode.
|
||||
*/
|
||||
[infallible] readonly attribute boolean isPrerendered;
|
||||
|
||||
/**
|
||||
* As an optimisation, setting the docshell's active state to
|
||||
* inactive also triggers a layer invalidation to free up some
|
||||
* potentially unhelpful memory usage. Calling preserveLayers
|
||||
* will cause the layers to be preserved even for inactive
|
||||
* docshells.
|
||||
*/
|
||||
void preserveLayers(in boolean aPreserveLayers);
|
||||
|
||||
/**
|
||||
* During interactions where painting performance
|
||||
* is more important than scrolling, we may temporarily
|
||||
* suppress the displayport. Each enable called must be matched
|
||||
* with a disable call.
|
||||
*/
|
||||
void suppressDisplayport(in bool aEnabled);
|
||||
|
||||
readonly attribute uint64_t tabId;
|
||||
|
||||
/**
|
||||
* The OS level process Id of the related child process.
|
||||
*/
|
||||
readonly attribute int32_t osPid;
|
||||
|
||||
/**
|
||||
* Navigate by key. If aForDocumentNavigation is true, navigate by document.
|
||||
* If aForDocumentNavigation is false, navigate by element.
|
||||
*
|
||||
* If aForward is true, navigate to the first focusable element or document.
|
||||
* If aForward is false, navigate to the last focusable element or document.
|
||||
*/
|
||||
void navigateByKey(in bool aForward, in bool aForDocumentNavigation);
|
||||
|
||||
readonly attribute boolean hasContentOpener;
|
||||
};
|
||||
589
dom/interfaces/base/nsITextInputProcessor.idl
Normal file
589
dom/interfaces/base/nsITextInputProcessor.idl
Normal file
|
|
@ -0,0 +1,589 @@
|
|||
/* -*- 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 mozIDOMWindow;
|
||||
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(47ae2181-2e98-4d58-84a2-b8db6764ce9a)]
|
||||
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 mozIDOMWindow 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 mozIDOMWindow 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;
|
||||
|
||||
// These values can be used to do bitwise operation with the return value of
|
||||
// the keydown() method.
|
||||
const unsigned long KEYEVENT_NOT_CONSUMED = 0x00000000;
|
||||
const unsigned long KEYDOWN_IS_CONSUMED = 0x00000001;
|
||||
const unsigned long KEYPRESS_IS_CONSUMED = 0x00000002;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* Gecko 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 KEYEVENT_NOT_CONSUMED, if the keydown event nor
|
||||
* the following keypress event(s) are consumed.
|
||||
* KEYDOWN_IS_CONSUMED, if the keydown event is
|
||||
* consumed. No keypress event will be dispatched in
|
||||
* this case.
|
||||
* KEYPRESS_IS_CONSUMED, if the keypress event(s) is
|
||||
* consumed when dispatched.
|
||||
* Note that keypress event is always consumed by
|
||||
* native code for the printable keys (indicating the
|
||||
* default action has been taken).
|
||||
*/
|
||||
[optional_argc]
|
||||
unsigned long 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"
|
||||
%}
|
||||
104
dom/interfaces/base/nsITextInputProcessorCallback.idl
Normal file
104
dom/interfaces/base/nsITextInputProcessorCallback.idl
Normal file
|
|
@ -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 Gecko 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 Gecko 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 Gecko 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 Gecko 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 Gecko 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);
|
||||
};
|
||||
13
dom/interfaces/canvas/moz.build
Normal file
13
dom/interfaces/canvas/moz.build
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMCanvasRenderingContext2D.idl',
|
||||
'nsIDOMWebGLRenderingContext.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_canvas'
|
||||
|
||||
33
dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
Normal file
33
dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/**
|
||||
* This interface remains only for the constants, for a context, use the
|
||||
* WebIDL/Paris bindings instead (CanvasRenderingContext2D.webidl).
|
||||
* The constants are used by CanvasRenderingContext2D::DrawWindow and are
|
||||
* used in WindowsPreviewPerTab.jsm and some extensions. The constants can
|
||||
* be referenced directly via a canvas context 2d rather than this interface,
|
||||
* and that should be preferred in new code.
|
||||
*/
|
||||
[uuid(4417cab7-c7eb-4e0c-b00a-c43842f0cba8)]
|
||||
interface nsIDOMCanvasRenderingContext2D : nsISupports
|
||||
{
|
||||
// Show the caret if appropriate when drawing
|
||||
const unsigned long DRAWWINDOW_DRAW_CARET = 0x01;
|
||||
// Don't flush pending layout notifications that could otherwise
|
||||
// be batched up
|
||||
const unsigned long DRAWWINDOW_DO_NOT_FLUSH = 0x02;
|
||||
// Draw scrollbars and scroll the viewport if they are present
|
||||
const unsigned long DRAWWINDOW_DRAW_VIEW = 0x04;
|
||||
// Use the widget layer manager if available. This means hardware
|
||||
// acceleration may be used, but it might actually be slower or
|
||||
// lower quality than normal. It will however more accurately reflect
|
||||
// the pixels rendered to the screen.
|
||||
const unsigned long DRAWWINDOW_USE_WIDGET_LAYERS = 0x08;
|
||||
// Don't synchronously decode images - draw what we have
|
||||
const unsigned long DRAWWINDOW_ASYNC_DECODE_IMAGES = 0x10;
|
||||
};
|
||||
15
dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
Normal file
15
dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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"
|
||||
|
||||
[builtinclass, uuid(f1a2fd3a-c6ac-4ee2-a700-5d285d5e3fff)]
|
||||
interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
{
|
||||
// get an underlying GL parameter, without any WebGL intervention.
|
||||
// Most useful for querying GL_VENDOR/GL_RENDERER for identifying
|
||||
// the underlying renderer to the user.
|
||||
[noscript] DOMString mozGetUnderlyingParamString(in unsigned long pname);
|
||||
};
|
||||
28
dom/interfaces/core/moz.build
Normal file
28
dom/interfaces/core/moz.build
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMAttr.idl',
|
||||
'nsIDOMCDATASection.idl',
|
||||
'nsIDOMCharacterData.idl',
|
||||
'nsIDOMComment.idl',
|
||||
'nsIDOMDocument.idl',
|
||||
'nsIDOMDocumentFragment.idl',
|
||||
'nsIDOMDocumentType.idl',
|
||||
'nsIDOMDOMException.idl',
|
||||
'nsIDOMDOMImplementation.idl',
|
||||
'nsIDOMElement.idl',
|
||||
'nsIDOMMozNamedAttrMap.idl',
|
||||
'nsIDOMNode.idl',
|
||||
'nsIDOMNodeList.idl',
|
||||
'nsIDOMNSEditableElement.idl',
|
||||
'nsIDOMProcessingInstruction.idl',
|
||||
'nsIDOMText.idl',
|
||||
'nsIDOMXMLDocument.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_core'
|
||||
|
||||
29
dom/interfaces/core/nsIDOMAttr.idl
Normal file
29
dom/interfaces/core/nsIDOMAttr.idl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- 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 "nsIDOMNode.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMAttr interface represents an attribute in an "Element" object.
|
||||
* Typically the allowable values for the attribute are defined in a document
|
||||
* type definition.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(7db491e8-a3a3-4432-ad67-e6c33e24ac6d)]
|
||||
interface nsIDOMAttr : nsIDOMNode
|
||||
{
|
||||
readonly attribute DOMString name;
|
||||
readonly attribute boolean specified;
|
||||
attribute DOMString value;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
// Introduced in DOM Level 2:
|
||||
readonly attribute nsIDOMElement ownerElement;
|
||||
|
||||
readonly attribute boolean isId;
|
||||
};
|
||||
21
dom/interfaces/core/nsIDOMCDATASection.idl
Normal file
21
dom/interfaces/core/nsIDOMCDATASection.idl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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 "nsIDOMText.idl"
|
||||
|
||||
/**
|
||||
* CDATA sections are used to escape blocks of text containing characters
|
||||
* that would otherwise be regarded as markup.
|
||||
* Their primary purpose is for including material such as XML fragments,
|
||||
* without needing to escape all the delimiters.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(e14ef131-34cc-40c8-9c99-a403c001184a)]
|
||||
interface nsIDOMCDATASection : nsIDOMText
|
||||
{
|
||||
};
|
||||
42
dom/interfaces/core/nsIDOMCharacterData.idl
Normal file
42
dom/interfaces/core/nsIDOMCharacterData.idl
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* -*- 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 "nsIDOMNode.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCharacterData interface extends nsIDOMNode with a set of
|
||||
* attributes and methods for accessing character data in the DOM.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(4109a2d2-e7af-445d-bb72-c7c9b875f35e)]
|
||||
interface nsIDOMCharacterData : nsIDOMNode
|
||||
{
|
||||
attribute DOMString data;
|
||||
// raises(DOMException) on setting
|
||||
// raises(DOMException) on retrieval
|
||||
|
||||
readonly attribute unsigned long length;
|
||||
DOMString substringData(in unsigned long offset,
|
||||
in unsigned long count)
|
||||
raises(DOMException);
|
||||
void appendData(in DOMString arg)
|
||||
raises(DOMException);
|
||||
void insertData(in unsigned long offset,
|
||||
in DOMString arg)
|
||||
raises(DOMException);
|
||||
void deleteData(in unsigned long offset,
|
||||
in unsigned long count)
|
||||
raises(DOMException);
|
||||
void replaceData(in unsigned long offset,
|
||||
in unsigned long count,
|
||||
in DOMString arg)
|
||||
raises(DOMException);
|
||||
|
||||
[binaryname(MozRemove)]
|
||||
void remove();
|
||||
};
|
||||
20
dom/interfaces/core/nsIDOMComment.idl
Normal file
20
dom/interfaces/core/nsIDOMComment.idl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* -*- 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 "nsIDOMCharacterData.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMComment interface inherits from nsIDOMCharacterData and represents
|
||||
* the content of a comment, i.e., all the characters between the starting
|
||||
* '<!--' and ending '-->'.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(e7866ff8-b7fc-494f-87c0-fb017d8a4d30)]
|
||||
interface nsIDOMComment : nsIDOMCharacterData
|
||||
{
|
||||
};
|
||||
52
dom/interfaces/core/nsIDOMDOMException.idl
Normal file
52
dom/interfaces/core/nsIDOMDOMException.idl
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* In general, DOM methods return specific error values in ordinary
|
||||
* processing situations, such as out-of-bound errors.
|
||||
* However, DOM operations can raise exceptions in "exceptional"
|
||||
* circumstances, i.e., when an operation is impossible to perform
|
||||
* (either for logical reasons, because data is lost, or because the
|
||||
* implementation has become unstable)
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#domexception
|
||||
*/
|
||||
|
||||
[uuid(5bd766d3-57a9-4833-995d-dbe21da29595)]
|
||||
interface nsIDOMDOMException : nsISupports
|
||||
{
|
||||
const unsigned short INDEX_SIZE_ERR = 1;
|
||||
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
|
||||
const unsigned short HIERARCHY_REQUEST_ERR = 3;
|
||||
const unsigned short WRONG_DOCUMENT_ERR = 4;
|
||||
const unsigned short INVALID_CHARACTER_ERR = 5;
|
||||
const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical
|
||||
const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
|
||||
const unsigned short NOT_FOUND_ERR = 8;
|
||||
const unsigned short NOT_SUPPORTED_ERR = 9;
|
||||
const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical
|
||||
const unsigned short INVALID_STATE_ERR = 11;
|
||||
const unsigned short SYNTAX_ERR = 12;
|
||||
const unsigned short INVALID_MODIFICATION_ERR = 13;
|
||||
const unsigned short NAMESPACE_ERR = 14;
|
||||
const unsigned short INVALID_ACCESS_ERR = 15;
|
||||
const unsigned short VALIDATION_ERR = 16; // historical
|
||||
const unsigned short TYPE_MISMATCH_ERR = 17;
|
||||
const unsigned short SECURITY_ERR = 18;
|
||||
const unsigned short NETWORK_ERR = 19;
|
||||
const unsigned short ABORT_ERR = 20;
|
||||
const unsigned short URL_MISMATCH_ERR = 21;
|
||||
const unsigned short QUOTA_EXCEEDED_ERR = 22;
|
||||
const unsigned short TIMEOUT_ERR = 23;
|
||||
const unsigned short INVALID_NODE_TYPE_ERR = 24;
|
||||
const unsigned short DATA_CLONE_ERR = 25;
|
||||
const unsigned short INVALID_POINTER_ERR = 26;
|
||||
|
||||
readonly attribute unsigned short code;
|
||||
};
|
||||
|
||||
42
dom/interfaces/core/nsIDOMDOMImplementation.idl
Normal file
42
dom/interfaces/core/nsIDOMDOMImplementation.idl
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMDOMImplementation interface provides a number of methods for
|
||||
* performing operations that are independent of any particular instance
|
||||
* of the document object model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(03a6f574-99ec-42f8-9e6c-812a4a9bcbf7)]
|
||||
interface nsIDOMDOMImplementation : nsISupports
|
||||
{
|
||||
boolean hasFeature(in DOMString feature,
|
||||
in DOMString version);
|
||||
|
||||
nsIDOMDocumentType createDocumentType(in DOMString qualifiedName,
|
||||
in DOMString publicId,
|
||||
in DOMString systemId)
|
||||
raises(DOMException);
|
||||
|
||||
nsIDOMDocument createDocument(in DOMString namespaceURI,
|
||||
in DOMString qualifiedName,
|
||||
in nsIDOMDocumentType doctype)
|
||||
raises(DOMException);
|
||||
|
||||
/**
|
||||
* Returns an HTML document with a basic DOM already constructed and with an
|
||||
* appropriate title element.
|
||||
*
|
||||
* @param title the title of the Document
|
||||
* @see <http://www.whatwg.org/html/#creating-documents>
|
||||
*/
|
||||
nsIDOMDocument createHTMLDocument([Null(Stringify)]
|
||||
in DOMString title);
|
||||
};
|
||||
415
dom/interfaces/core/nsIDOMDocument.idl
Normal file
415
dom/interfaces/core/nsIDOMDocument.idl
Normal file
|
|
@ -0,0 +1,415 @@
|
|||
/* -*- 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 "nsIDOMNode.idl"
|
||||
|
||||
%{ C++
|
||||
#include "jspubtd.h"
|
||||
|
||||
// windows.h #defines CreateEvent
|
||||
#ifdef CreateEvent
|
||||
#undef CreateEvent
|
||||
#endif
|
||||
%}
|
||||
|
||||
interface mozIDOMWindowProxy;
|
||||
interface nsIDOMNodeIterator;
|
||||
interface nsIDOMNodeFilter;
|
||||
interface nsIDOMTreeWalker;
|
||||
interface nsIDOMLocation;
|
||||
|
||||
/**
|
||||
* The nsIDOMDocument interface represents the entire HTML or XML document.
|
||||
* Conceptually, it is the root of the document tree, and provides the
|
||||
* primary access to the document's data.
|
||||
* Since elements, text nodes, comments, processing instructions, etc.
|
||||
* cannot exist outside the context of a Document, the nsIDOMDocument
|
||||
* interface also contains the factory methods needed to create these
|
||||
* objects.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(b15fa0f4-97c1-4388-af62-2ceff7a89bdf)]
|
||||
interface nsIDOMDocument : nsIDOMNode
|
||||
{
|
||||
readonly attribute nsIDOMDocumentType doctype;
|
||||
readonly attribute nsIDOMDOMImplementation implementation;
|
||||
readonly attribute nsIDOMElement documentElement;
|
||||
nsIDOMElement createElement([Null(Stringify)] in DOMString tagName)
|
||||
raises(DOMException);
|
||||
nsIDOMDocumentFragment createDocumentFragment();
|
||||
nsIDOMText createTextNode(in DOMString data);
|
||||
nsIDOMComment createComment(in DOMString data);
|
||||
nsIDOMCDATASection createCDATASection(in DOMString data)
|
||||
raises(DOMException);
|
||||
nsIDOMProcessingInstruction createProcessingInstruction(in DOMString target,
|
||||
in DOMString data)
|
||||
raises(DOMException);
|
||||
nsIDOMAttr createAttribute(in DOMString name)
|
||||
raises(DOMException);
|
||||
nsIDOMNodeList getElementsByTagName(in DOMString tagname);
|
||||
|
||||
// Introduced in DOM Level 2:
|
||||
[optional_argc] nsIDOMNode importNode(in nsIDOMNode importedNode,
|
||||
[optional] in boolean deep)
|
||||
raises(DOMException);
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMElement createElementNS(in DOMString namespaceURI,
|
||||
[Null(Stringify)] in DOMString qualifiedName)
|
||||
raises(DOMException);
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMAttr createAttributeNS(in DOMString namespaceURI,
|
||||
in DOMString qualifiedName)
|
||||
raises(DOMException);
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMNodeList getElementsByTagNameNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMElement getElementById(in DOMString elementId);
|
||||
// Introduced in DOM Level 3:
|
||||
readonly attribute DOMString inputEncoding;
|
||||
// Introduced in DOM Level 3:
|
||||
readonly attribute DOMString documentURI;
|
||||
// Alias introduced for all documents in recent DOM standards
|
||||
readonly attribute DOMString URL;
|
||||
// Introduced in DOM Level 3:
|
||||
nsIDOMNode adoptNode(in nsIDOMNode source)
|
||||
raises(DOMException);
|
||||
|
||||
/**
|
||||
* Create a range
|
||||
*
|
||||
* @see http://html5.org/specs/dom-range.html#dom-document-createrange
|
||||
*/
|
||||
nsIDOMRange createRange();
|
||||
|
||||
[optional_argc] nsIDOMNodeIterator createNodeIterator(in nsIDOMNode root,
|
||||
[optional] in unsigned long whatToShow,
|
||||
[optional] in nsIDOMNodeFilter filter)
|
||||
raises(DOMException);
|
||||
[optional_argc] nsIDOMTreeWalker createTreeWalker(in nsIDOMNode root,
|
||||
[optional] in unsigned long whatToShow,
|
||||
[optional] in nsIDOMNodeFilter filter)
|
||||
raises(DOMException);
|
||||
|
||||
nsIDOMEvent createEvent(in DOMString eventType)
|
||||
raises(DOMException);
|
||||
|
||||
|
||||
// HTML
|
||||
/**
|
||||
* The window associated with this document.
|
||||
*
|
||||
* @see <http://www.whatwg.org/html/#dom-document-defaultview>
|
||||
*/
|
||||
readonly attribute mozIDOMWindowProxy defaultView;
|
||||
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-characterset>
|
||||
*/
|
||||
readonly attribute DOMString characterSet;
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-dir>
|
||||
*/
|
||||
attribute DOMString dir;
|
||||
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-location>
|
||||
*/
|
||||
readonly attribute nsIDOMLocation location;
|
||||
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#document.title>
|
||||
*/
|
||||
attribute DOMString title;
|
||||
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-readystate>
|
||||
*/
|
||||
readonly attribute DOMString readyState;
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-lastmodified>
|
||||
*/
|
||||
readonly attribute DOMString lastModified;
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-referrer>
|
||||
*/
|
||||
readonly attribute DOMString referrer;
|
||||
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-hasfocus>
|
||||
*/
|
||||
boolean hasFocus();
|
||||
|
||||
/**
|
||||
* @see <http://www.whatwg.org/html/#dom-document-activeelement>
|
||||
*/
|
||||
readonly attribute nsIDOMElement activeElement;
|
||||
|
||||
/**
|
||||
* Retrieve elements matching all classes listed in a
|
||||
* space-separated string.
|
||||
*
|
||||
* @see <http://www.whatwg.org/html/#dom-document-getelementsbyclassname>
|
||||
*/
|
||||
nsIDOMNodeList getElementsByClassName(in DOMString classes);
|
||||
|
||||
|
||||
// CSSOM
|
||||
/**
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-stylesheets>
|
||||
*/
|
||||
readonly attribute nsIDOMStyleSheetList styleSheets;
|
||||
|
||||
/**
|
||||
* This attribute must return the preferred style sheet set as set by the
|
||||
* author. It is determined from the order of style sheet declarations and
|
||||
* the Default-Style HTTP headers, as eventually defined elsewhere in the Web
|
||||
* Apps 1.0 specification. If there is no preferred style sheet set, this
|
||||
* attribute must return the empty string. The case of this attribute must
|
||||
* exactly match the case given by the author where the preferred style sheet
|
||||
* is specified or implied. This attribute must never return null.
|
||||
*
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-preferredStyleSheetSet>
|
||||
*/
|
||||
readonly attribute DOMString preferredStyleSheetSet;
|
||||
|
||||
/**
|
||||
* This attribute indicates which style sheet set is in use. This attribute
|
||||
* is live; changing the disabled attribute on style sheets directly will
|
||||
* change the value of this attribute.
|
||||
*
|
||||
* If all the sheets that are enabled and have a title have the same title
|
||||
* (by case-sensitive comparisons) then the value of this attribute must be
|
||||
* exactly equal to the title of the first enabled style sheet with a title
|
||||
* in the styleSheets list. Otherwise, if style sheets from different sets
|
||||
* are enabled, then the return value must be null (there is no way to
|
||||
* determine what the currently selected style sheet set is in those
|
||||
* conditions). Otherwise, either all style sheets that have a title are
|
||||
* disabled, or there are no alternate style sheets, and
|
||||
* selectedStyleSheetSet must return the empty string.
|
||||
*
|
||||
* Setting this attribute to the null value must have no effect.
|
||||
*
|
||||
* Setting this attribute to a non-null value must call
|
||||
* enableStyleSheetsForSet() with that value as the function's argument, and
|
||||
* set lastStyleSheetSet to that value.
|
||||
*
|
||||
* From the DOM's perspective, all views have the same
|
||||
* selectedStyleSheetSet. If a UA supports multiple views with different
|
||||
* selected alternate style sheets, then this attribute (and the StyleSheet
|
||||
* interface's disabled attribute) must return and set the value for the
|
||||
* default view.
|
||||
*
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-selectedStyleSheetSet>
|
||||
*/
|
||||
[binaryname(MozSelectedStyleSheetSet)]
|
||||
attribute DOMString selectedStyleSheetSet;
|
||||
|
||||
/*
|
||||
* This property must initially have the value null. Its value changes when
|
||||
* the selectedStyleSheetSet attribute is set.
|
||||
*
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-lastStyleSheetSet>
|
||||
*/
|
||||
readonly attribute DOMString lastStyleSheetSet;
|
||||
|
||||
/**
|
||||
* This must return the live list of the currently available style sheet
|
||||
* sets. This list is constructed by enumerating all the style sheets for
|
||||
* this document available to the implementation, in the order they are
|
||||
* listed in the styleSheets attribute, adding the title of each style sheet
|
||||
* with a title to the list, avoiding duplicates by dropping titles that
|
||||
* match (case-sensitively) titles that have already been added to the
|
||||
* list.
|
||||
*
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-styleSheetSets>
|
||||
*/
|
||||
readonly attribute nsISupports styleSheetSets;
|
||||
|
||||
/**
|
||||
* Calling this method must change the disabled attribute on each StyleSheet
|
||||
* object with a title attribute with a length greater than 0 in the
|
||||
* styleSheets attribute, so that all those whose title matches the name
|
||||
* argument are enabled, and all others are disabled. Title matches must be
|
||||
* case-sensitive. Calling this method with the empty string disables all
|
||||
* alternate and preferred style sheets (but does not change the state of
|
||||
* persistent style sheets, that is those with no title attribute).
|
||||
*
|
||||
* Calling this method with a null value must have no effect.
|
||||
*
|
||||
* Style sheets that do not have a title are never affected by this
|
||||
* method. This method does not change the values of the lastStyleSheetSet or
|
||||
* preferredStyleSheetSet attributes.
|
||||
*
|
||||
* @see <http://dev.w3.org/csswg/cssom/#dom-document-enableStyleSheetsForSet>
|
||||
*/
|
||||
[binaryname(MozEnableStyleSheetsForSet)]
|
||||
void enableStyleSheetsForSet(in DOMString name);
|
||||
|
||||
|
||||
// CSSOM-View
|
||||
/**
|
||||
* Returns the element from the caller's document at the given point,
|
||||
* relative to the upper-left-most point in the (possibly scrolled)
|
||||
* window or frame.
|
||||
*
|
||||
* If the element at the given point belongs to another document (such as
|
||||
* an iframe's subdocument), the element in the calling document's DOM
|
||||
* (e.g. the iframe) is returned. If the element at the given point is
|
||||
* anonymous or XBL generated content, such as a textbox's scrollbars, then
|
||||
* the first non-anonymous parent element (that is, the textbox) is returned.
|
||||
*
|
||||
* This method returns null if either coordinate is negative, or if the
|
||||
* specified point lies outside the visible bounds of the document.
|
||||
*
|
||||
* Callers from XUL documents should wait until the onload event has fired
|
||||
* before calling this method.
|
||||
*
|
||||
* @see <http://dev.w3.org/csswg/cssom-view/#dom-document-elementfrompoint>
|
||||
*/
|
||||
nsIDOMElement elementFromPoint(in float x, in float y);
|
||||
|
||||
|
||||
// Mozilla extensions
|
||||
/**
|
||||
* @see <https://developer.mozilla.org/en/DOM/document.contentType>
|
||||
*/
|
||||
readonly attribute DOMString contentType;
|
||||
|
||||
/**
|
||||
* True if this document is synthetic : stand alone image, video, audio file,
|
||||
* etc.
|
||||
*/
|
||||
readonly attribute boolean mozSyntheticDocument;
|
||||
|
||||
/**
|
||||
* Returns the script element whose script is currently being processed.
|
||||
*
|
||||
* @see <https://developer.mozilla.org/en/DOM/document.currentScript>
|
||||
*/
|
||||
readonly attribute nsIDOMElement currentScript;
|
||||
|
||||
/**
|
||||
* Release the current mouse capture if it is on an element within this
|
||||
* document.
|
||||
*
|
||||
* @see <https://developer.mozilla.org/en/DOM/document.releaseCapture>
|
||||
*/
|
||||
void releaseCapture();
|
||||
|
||||
/**
|
||||
* Use the given DOM element as the source image of target |-moz-element()|.
|
||||
*
|
||||
* This function introduces a new special ID (called "image element ID"),
|
||||
* which is only used by |-moz-element()|, and associates it with the given
|
||||
* DOM element. Image elements ID's have the higher precedence than general
|
||||
* HTML id's, so if |document.mozSetImageElement(<id>, <element>)| is called,
|
||||
* |-moz-element(#<id>)| uses |<element>| as the source image even if there
|
||||
* is another element with id attribute = |<id>|. To unregister an image
|
||||
* element ID |<id>|, call |document.mozSetImageElement(<id>, null)|.
|
||||
*
|
||||
* Example:
|
||||
* <script>
|
||||
* canvas = document.createElement("canvas");
|
||||
* canvas.setAttribute("width", 100);
|
||||
* canvas.setAttribute("height", 100);
|
||||
* // draw to canvas
|
||||
* document.mozSetImageElement("canvasbg", canvas);
|
||||
* </script>
|
||||
* <div style="background-image: -moz-element(#canvasbg);"></div>
|
||||
*
|
||||
* @param aImageElementId an image element ID to associate with
|
||||
* |aImageElement|
|
||||
* @param aImageElement a DOM element to be used as the source image of
|
||||
* |-moz-element(#aImageElementId)|. If this is null, the function will
|
||||
* unregister the image element ID |aImageElementId|.
|
||||
*
|
||||
* @see <https://developer.mozilla.org/en/DOM/document.mozSetImageElement>
|
||||
*/
|
||||
void mozSetImageElement(in DOMString aImageElementId,
|
||||
in nsIDOMElement aImageElement);
|
||||
|
||||
/**
|
||||
* Element which is currently the full-screen element as per the DOM
|
||||
* full-screen api.
|
||||
*
|
||||
* @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
|
||||
*/
|
||||
readonly attribute nsIDOMElement mozFullScreenElement;
|
||||
|
||||
/**
|
||||
* Causes the document to leave DOM full-screen mode, if it's in
|
||||
* full-screen mode, as per the DOM full-screen api.
|
||||
*
|
||||
* @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
|
||||
*/
|
||||
void mozCancelFullScreen();
|
||||
|
||||
/**
|
||||
* Denotes whether this document is in DOM full-screen mode, as per the DOM
|
||||
* full-screen api.
|
||||
*
|
||||
* @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
|
||||
*/
|
||||
readonly attribute boolean mozFullScreen;
|
||||
|
||||
/**
|
||||
* Denotes whether the full-screen-api.enabled is true, no windowed
|
||||
* plugins are present, and all ancestor documents have the
|
||||
* allowfullscreen attribute set.
|
||||
*
|
||||
* @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
|
||||
*/
|
||||
readonly attribute boolean mozFullScreenEnabled;
|
||||
|
||||
/**
|
||||
* The element to which the mouse pointer is locked, if any, as per the
|
||||
* DOM pointer lock api.
|
||||
*
|
||||
* @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
|
||||
*/
|
||||
readonly attribute nsIDOMElement mozPointerLockElement;
|
||||
|
||||
/**
|
||||
* Retrieve the location of the caret position (DOM node and character
|
||||
* offset within that node), given a point.
|
||||
*
|
||||
* @param x Horizontal point at which to determine the caret position, in
|
||||
* page coordinates.
|
||||
* @param y Vertical point at which to determine the caret position, in
|
||||
* page coordinates.
|
||||
*/
|
||||
nsISupports /* CaretPosition */ caretPositionFromPoint(in float x, in float y);
|
||||
|
||||
/**
|
||||
* Exit pointer is lock if locked, as per the DOM pointer lock api.
|
||||
*
|
||||
* @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
|
||||
*/
|
||||
void mozExitPointerLock();
|
||||
|
||||
/**
|
||||
* Visibility API implementation.
|
||||
*/
|
||||
readonly attribute boolean hidden;
|
||||
readonly attribute DOMString visibilityState;
|
||||
|
||||
/**
|
||||
* Returns "BackCompat" if we're in quirks mode or "CSS1Compat" if we're in
|
||||
* strict mode. (XML documents are always in strict mode.)
|
||||
*/
|
||||
readonly attribute DOMString compatMode;
|
||||
|
||||
/**
|
||||
* Return nodes that match a given CSS selector.
|
||||
*
|
||||
* @see <http://dev.w3.org/2006/webapi/selectors-api/>
|
||||
*/
|
||||
nsIDOMElement querySelector([Null(Stringify)] in DOMString selectors);
|
||||
nsIDOMNodeList querySelectorAll([Null(Stringify)] in DOMString selectors);
|
||||
};
|
||||
27
dom/interfaces/core/nsIDOMDocumentFragment.idl
Normal file
27
dom/interfaces/core/nsIDOMDocumentFragment.idl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* -*- 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 "nsIDOMNode.idl"
|
||||
|
||||
/**
|
||||
* DocumentFragment is a "lightweight" or "minimal" Document object.
|
||||
* nsIDOMDocumentFragment is used in situations where the Document
|
||||
* interface can potentially be a heavyweight interface.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(48eb8d72-95bb-402e-a8fc-f2b187abcbdb)]
|
||||
interface nsIDOMDocumentFragment : nsIDOMNode
|
||||
{
|
||||
/**
|
||||
* Return nodes that match a given CSS selector.
|
||||
*
|
||||
* @see <http://dev.w3.org/2006/webapi/selectors-api/>
|
||||
*/
|
||||
nsIDOMElement querySelector([Null(Stringify)] in DOMString selectors);
|
||||
nsIDOMNodeList querySelectorAll([Null(Stringify)] in DOMString selectors);
|
||||
};
|
||||
28
dom/interfaces/core/nsIDOMDocumentType.idl
Normal file
28
dom/interfaces/core/nsIDOMDocumentType.idl
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/* -*- 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 "nsIDOMNode.idl"
|
||||
|
||||
/**
|
||||
* Each Document has a doctype attribute whose value is either null
|
||||
* or a DocumentType object.
|
||||
* The nsIDOMDocumentType interface in the DOM Core provides an
|
||||
* interface to the list of entities that are defined for the document.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
[uuid(cd7467b9-0f26-4787-a359-66e80ba8db92)]
|
||||
interface nsIDOMDocumentType : nsIDOMNode
|
||||
{
|
||||
readonly attribute DOMString name;
|
||||
readonly attribute DOMString publicId;
|
||||
readonly attribute DOMString systemId;
|
||||
readonly attribute DOMString internalSubset;
|
||||
|
||||
[binaryname(MozRemove)]
|
||||
void remove();
|
||||
};
|
||||
229
dom/interfaces/core/nsIDOMElement.idl
Normal file
229
dom/interfaces/core/nsIDOMElement.idl
Normal file
|
|
@ -0,0 +1,229 @@
|
|||
/* -*- 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 "nsIDOMNode.idl"
|
||||
|
||||
interface nsIDOMMozNamedAttrMap;
|
||||
|
||||
%{C++
|
||||
// Undo the windows.h damage
|
||||
#undef GetMessage
|
||||
#undef CreateEvent
|
||||
#undef GetClassName
|
||||
#undef GetBinaryType
|
||||
#undef RemoveDirectory
|
||||
%}
|
||||
|
||||
/**
|
||||
* The nsIDOMElement interface represents an element in an HTML or
|
||||
* XML document.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-element
|
||||
*/
|
||||
|
||||
[uuid(6289999b-1008-4269-b42a-413ec5a9d3f4)]
|
||||
interface nsIDOMElement : nsIDOMNode
|
||||
{
|
||||
readonly attribute DOMString tagName;
|
||||
|
||||
attribute DOMString id;
|
||||
attribute DOMString className;
|
||||
/**
|
||||
* Returns a DOMTokenList object reflecting the class attribute.
|
||||
*/
|
||||
readonly attribute nsISupports classList;
|
||||
|
||||
readonly attribute nsIDOMMozNamedAttrMap attributes;
|
||||
DOMString getAttribute(in DOMString name);
|
||||
DOMString getAttributeNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
void setAttribute(in DOMString name,
|
||||
in DOMString value);
|
||||
void setAttributeNS(in DOMString namespaceURI,
|
||||
in DOMString qualifiedName,
|
||||
in DOMString value);
|
||||
void removeAttribute(in DOMString name);
|
||||
void removeAttributeNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
boolean hasAttribute(in DOMString name);
|
||||
boolean hasAttributeNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
boolean hasAttributes();
|
||||
|
||||
// Obsolete methods.
|
||||
nsIDOMAttr getAttributeNode(in DOMString name);
|
||||
nsIDOMAttr setAttributeNode(in nsIDOMAttr newAttr);
|
||||
nsIDOMAttr removeAttributeNode(in nsIDOMAttr oldAttr);
|
||||
nsIDOMAttr getAttributeNodeNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
nsIDOMAttr setAttributeNodeNS(in nsIDOMAttr newAttr)
|
||||
raises(DOMException);
|
||||
|
||||
nsIDOMHTMLCollection getElementsByTagName(in DOMString name);
|
||||
nsIDOMHTMLCollection getElementsByTagNameNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
/**
|
||||
* Retrieve elements matching all classes listed in a
|
||||
* space-separated string.
|
||||
*/
|
||||
nsIDOMHTMLCollection getElementsByClassName(in DOMString classes);
|
||||
|
||||
/**
|
||||
* Returns a live nsIDOMNodeList of the current child elements.
|
||||
*/
|
||||
[binaryname(ChildElements)]
|
||||
readonly attribute nsIDOMNodeList children;
|
||||
/**
|
||||
* Similar as the attributes on nsIDOMNode, but navigates just elements
|
||||
* rather than all nodes.
|
||||
*/
|
||||
readonly attribute nsIDOMElement firstElementChild;
|
||||
readonly attribute nsIDOMElement lastElementChild;
|
||||
readonly attribute nsIDOMElement previousElementSibling;
|
||||
readonly attribute nsIDOMElement nextElementSibling;
|
||||
/**
|
||||
* Returns the number of child nodes that are nsIDOMElements.
|
||||
*/
|
||||
readonly attribute unsigned long childElementCount;
|
||||
|
||||
[binaryname(MozRemove)]
|
||||
void remove();
|
||||
|
||||
// CSSOM View
|
||||
/**
|
||||
* Retrieve a list of rectangles, one for each CSS border-box associated with
|
||||
* the element. The coordinates are in CSS pixels, and relative to
|
||||
* the top-left of the document's viewport, unless the document
|
||||
* has an SVG foreignobject ancestor, in which case the coordinates are
|
||||
* relative to the top-left of the content box of the nearest SVG foreignobject
|
||||
* ancestor. The coordinates are calculated as if every scrollable element
|
||||
* is scrolled to its default position.
|
||||
*
|
||||
* Note: the boxes of overflowing children do not affect these rectangles.
|
||||
* Note: some elements have empty CSS boxes. Those return empty rectangles,
|
||||
* but the coordinates may still be meaningful.
|
||||
* Note: some elements have no CSS boxes (including display:none elements,
|
||||
* HTML AREA elements, and SVG elements that do not render). Those return
|
||||
* an empty list.
|
||||
*/
|
||||
nsIDOMClientRectList getClientRects();
|
||||
|
||||
/**
|
||||
* Returns the union of all rectangles in the getClientRects() list. Empty
|
||||
* rectangles are ignored, except that if all rectangles are empty,
|
||||
* we return an empty rectangle positioned at the top-left of the first
|
||||
* rectangle in getClientRects().
|
||||
*/
|
||||
nsIDOMClientRect getBoundingClientRect();
|
||||
|
||||
/**
|
||||
* The vertical scroll position of the element, or 0 if the element is not
|
||||
* scrollable. This property may be assigned a value to change the
|
||||
* vertical scroll position.
|
||||
*/
|
||||
attribute long scrollTop;
|
||||
|
||||
/**
|
||||
* The horizontal scroll position of the element, or 0 if the element is not
|
||||
* scrollable. This property may be assigned a value to change the
|
||||
* horizontal scroll position.
|
||||
*/
|
||||
attribute long scrollLeft;
|
||||
|
||||
/**
|
||||
* The width of the scrollable area of the element. If the element is not
|
||||
* scrollable, scrollWidth is equivalent to the offsetWidth.
|
||||
*/
|
||||
readonly attribute long scrollWidth;
|
||||
|
||||
/**
|
||||
* The height of the scrollable area of the element. If the element is not
|
||||
* scrollable, scrollHeight is equivalent to the offsetHeight.
|
||||
*/
|
||||
readonly attribute long scrollHeight;
|
||||
|
||||
/**
|
||||
* The height in CSS pixels of the element's top border.
|
||||
*/
|
||||
readonly attribute long clientTop;
|
||||
|
||||
/**
|
||||
* The width in CSS pixels of the element's left border and scrollbar
|
||||
* if it is present on the left side.
|
||||
*/
|
||||
readonly attribute long clientLeft;
|
||||
|
||||
/**
|
||||
* The height in CSS pixels of the element's padding box. If the element is
|
||||
* scrollable, the scroll bars are included inside this width.
|
||||
*/
|
||||
readonly attribute long clientWidth;
|
||||
|
||||
/**
|
||||
* The width in CSS pixels of the element's padding box. If the element is
|
||||
* scrollable, the scroll bars are included inside this height.
|
||||
*/
|
||||
readonly attribute long clientHeight;
|
||||
|
||||
/* The maximum offset that the element can be scrolled to
|
||||
(i.e., the value that scrollLeft/scrollTop would be clamped to if they were
|
||||
set to arbitrarily large values. */
|
||||
readonly attribute long scrollLeftMax;
|
||||
readonly attribute long scrollTopMax;
|
||||
|
||||
|
||||
// Selectors API
|
||||
/**
|
||||
* Returns whether this element would be selected by the given selector
|
||||
* string.
|
||||
*
|
||||
* See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
|
||||
*/
|
||||
boolean mozMatchesSelector([Null(Stringify)] in DOMString selector);
|
||||
|
||||
|
||||
// Proprietary extensions
|
||||
/**
|
||||
* Set this during a mousedown event to grab and retarget all mouse events
|
||||
* to this element until the mouse button is released or releaseCapture is
|
||||
* called. If retargetToElement is true, then all events are targetted at
|
||||
* this element. If false, events can also fire at descendants of this
|
||||
* element.
|
||||
*
|
||||
*/
|
||||
void setCapture([optional] in boolean retargetToElement);
|
||||
|
||||
/**
|
||||
* If this element has captured the mouse, release the capture. If another
|
||||
* element has captured the mouse, this method has no effect.
|
||||
*/
|
||||
void releaseCapture();
|
||||
|
||||
// Mozilla extensions
|
||||
/**
|
||||
* Requests that this element be made the full-screen element, as per the DOM
|
||||
* full-screen api.
|
||||
*
|
||||
* @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
|
||||
*/
|
||||
void mozRequestFullScreen();
|
||||
|
||||
/**
|
||||
* Requests that this element be made the pointer-locked element, as per the DOM
|
||||
* pointer lock api.
|
||||
*
|
||||
* @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
|
||||
*/
|
||||
void mozRequestPointerLock();
|
||||
|
||||
/**
|
||||
* Return nodes that match a given CSS selector.
|
||||
*
|
||||
* @see <http://dev.w3.org/2006/webapi/selectors-api/>
|
||||
*/
|
||||
nsIDOMElement querySelector([Null(Stringify)] in DOMString selectors);
|
||||
nsIDOMNodeList querySelectorAll([Null(Stringify)] in DOMString selectors);
|
||||
};
|
||||
33
dom/interfaces/core/nsIDOMMozNamedAttrMap.idl
Normal file
33
dom/interfaces/core/nsIDOMMozNamedAttrMap.idl
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* This is a temporary, non-standard interface, to ease the transition to a
|
||||
* world where Attr no longer inherits from Node.
|
||||
*/
|
||||
|
||||
[uuid(cb5564cd-26ec-418f-a6d6-1d57cd2c971c)]
|
||||
interface nsIDOMMozNamedAttrMap : nsISupports
|
||||
{
|
||||
nsIDOMAttr getNamedItem(in DOMString name);
|
||||
nsIDOMAttr setNamedItem(in nsIDOMAttr arg)
|
||||
raises(DOMException);
|
||||
nsIDOMAttr removeNamedItem(in DOMString name)
|
||||
raises(DOMException);
|
||||
nsIDOMAttr item(in unsigned long index);
|
||||
readonly attribute unsigned long length;
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMAttr getNamedItemNS(in DOMString namespaceURI,
|
||||
in DOMString localName);
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMAttr setNamedItemNS(in nsIDOMAttr arg)
|
||||
raises(DOMException);
|
||||
// Introduced in DOM Level 2:
|
||||
nsIDOMAttr removeNamedItemNS(in DOMString namespaceURI,
|
||||
in DOMString localName)
|
||||
raises(DOMException);
|
||||
};
|
||||
28
dom/interfaces/core/nsIDOMNSEditableElement.idl
Normal file
28
dom/interfaces/core/nsIDOMNSEditableElement.idl
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/* -*- 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 nsIEditor;
|
||||
|
||||
/**
|
||||
* This interface is implemented by elements which have inner editable content,
|
||||
* such as HTML input and textarea.
|
||||
*
|
||||
* Please make sure to update the HTMLTextAreaElement and HTMLInputElement
|
||||
* Web IDL interfaces to mirror this interface when changing it.
|
||||
*
|
||||
*/
|
||||
|
||||
[scriptable, uuid(3503de34-6631-4594-b7be-c36ff6a520c4)]
|
||||
interface nsIDOMNSEditableElement : nsISupports
|
||||
{
|
||||
[noscript] readonly attribute nsIEditor editor;
|
||||
// This is similar to set .value on nsIDOMInput/TextAreaElements, but
|
||||
// handling of the value change is closer to the normal user input, so
|
||||
// 'change' event for example will be dispatched when focusing out the
|
||||
// element.
|
||||
[noscript] void setUserInput(in DOMString input);
|
||||
};
|
||||
111
dom/interfaces/core/nsIDOMNode.idl
Normal file
111
dom/interfaces/core/nsIDOMNode.idl
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/* -*- 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 nsIVariant;
|
||||
|
||||
/**
|
||||
* The nsIDOMNode interface is the primary datatype for the entire
|
||||
* Document Object Model.
|
||||
* It represents a single node in the document tree.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(cc35b412-009b-46a3-9be0-76448f12548d)]
|
||||
interface nsIDOMNode : nsISupports
|
||||
{
|
||||
const unsigned short ELEMENT_NODE = 1;
|
||||
const unsigned short ATTRIBUTE_NODE = 2;
|
||||
const unsigned short TEXT_NODE = 3;
|
||||
const unsigned short CDATA_SECTION_NODE = 4;
|
||||
const unsigned short ENTITY_REFERENCE_NODE = 5;
|
||||
const unsigned short ENTITY_NODE = 6;
|
||||
const unsigned short PROCESSING_INSTRUCTION_NODE = 7;
|
||||
const unsigned short COMMENT_NODE = 8;
|
||||
const unsigned short DOCUMENT_NODE = 9;
|
||||
const unsigned short DOCUMENT_TYPE_NODE = 10;
|
||||
const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
|
||||
const unsigned short NOTATION_NODE = 12;
|
||||
|
||||
readonly attribute DOMString nodeName;
|
||||
attribute DOMString nodeValue;
|
||||
// raises(DOMException) on setting
|
||||
// raises(DOMException) on retrieval
|
||||
readonly attribute unsigned short nodeType;
|
||||
readonly attribute nsIDOMNode parentNode;
|
||||
readonly attribute nsIDOMElement parentElement;
|
||||
readonly attribute nsIDOMNodeList childNodes;
|
||||
readonly attribute nsIDOMNode firstChild;
|
||||
readonly attribute nsIDOMNode lastChild;
|
||||
readonly attribute nsIDOMNode previousSibling;
|
||||
readonly attribute nsIDOMNode nextSibling;
|
||||
// Modified in DOM Level 2:
|
||||
readonly attribute nsIDOMDocument ownerDocument;
|
||||
nsIDOMNode insertBefore(in nsIDOMNode newChild,
|
||||
in nsIDOMNode refChild)
|
||||
raises(DOMException);
|
||||
nsIDOMNode replaceChild(in nsIDOMNode newChild,
|
||||
in nsIDOMNode oldChild)
|
||||
raises(DOMException);
|
||||
nsIDOMNode removeChild(in nsIDOMNode oldChild)
|
||||
raises(DOMException);
|
||||
nsIDOMNode appendChild(in nsIDOMNode newChild)
|
||||
raises(DOMException);
|
||||
boolean hasChildNodes();
|
||||
// Modified in DOM Level 4:
|
||||
[optional_argc] nsIDOMNode cloneNode([optional] in boolean deep);
|
||||
// Modified in DOM Level 2:
|
||||
void normalize();
|
||||
// Introduced in DOM Level 2:
|
||||
readonly attribute DOMString namespaceURI;
|
||||
// Modified in DOM Core
|
||||
readonly attribute DOMString prefix;
|
||||
|
||||
// Introduced in DOM Level 2:
|
||||
readonly attribute DOMString localName;
|
||||
|
||||
// For vtable compatibility (see bug 1078674)
|
||||
[noscript] bool unusedPlaceholder();
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
// This uses a binaryname to avoid warnings due to name collision with
|
||||
// nsINode::GetBaseURI
|
||||
[binaryname(DOMBaseURI)] readonly attribute DOMString baseURI;
|
||||
|
||||
// DocumentPosition
|
||||
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
|
||||
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
|
||||
const unsigned short DOCUMENT_POSITION_FOLLOWING = 0x04;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINS = 0x08;
|
||||
const unsigned short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
|
||||
const unsigned short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
unsigned short compareDocumentPosition(in nsIDOMNode other)
|
||||
raises(DOMException);
|
||||
// Introduced in DOM Level 3:
|
||||
attribute DOMString textContent;
|
||||
// raises(DOMException) on setting
|
||||
// raises(DOMException) on retrieval
|
||||
|
||||
// Introduced in DOM Level 3:
|
||||
DOMString lookupPrefix(in DOMString namespaceURI);
|
||||
// Introduced in DOM Level 3:
|
||||
boolean isDefaultNamespace(in DOMString namespaceURI);
|
||||
// Introduced in DOM Level 3:
|
||||
DOMString lookupNamespaceURI(in DOMString prefix);
|
||||
// Introduced in DOM Level 3:
|
||||
boolean isEqualNode(in nsIDOMNode arg);
|
||||
// Introduced in DOM Level 3:
|
||||
nsIVariant setUserData(in DOMString key,
|
||||
in nsIVariant data);
|
||||
// Introduced in DOM Level 3:
|
||||
nsIVariant getUserData(in DOMString key);
|
||||
|
||||
boolean contains(in nsIDOMNode aOther);
|
||||
};
|
||||
25
dom/interfaces/core/nsIDOMNodeList.idl
Normal file
25
dom/interfaces/core/nsIDOMNodeList.idl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMNodeList interface provides the abstraction of an ordered
|
||||
* collection of nodes, without defining or constraining how this collection
|
||||
* is implemented.
|
||||
* The items in the list are accessible via an integral index, starting from 0.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/
|
||||
*/
|
||||
|
||||
// NOTE: Please do not attempt to make this not scriptable,
|
||||
// see https://bugzilla.mozilla.org/show_bug.cgi?id=994964#c73.
|
||||
[scriptable, uuid(450cf0ba-de90-4f86-85bf-e10cc8b8713f)]
|
||||
interface nsIDOMNodeList : nsISupports
|
||||
{
|
||||
nsIDOMNode item(in unsigned long index);
|
||||
readonly attribute unsigned long length;
|
||||
};
|
||||
22
dom/interfaces/core/nsIDOMProcessingInstruction.idl
Normal file
22
dom/interfaces/core/nsIDOMProcessingInstruction.idl
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* -*- 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 "nsIDOMCharacterData.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMProcessingInstruction interface represents a
|
||||
* "processing instruction", used in XML as a way to keep processor-specific
|
||||
* information in the text of the document.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Core/ and
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(5a139df7-04d0-438d-bd18-d8122564258f)]
|
||||
interface nsIDOMProcessingInstruction : nsIDOMCharacterData
|
||||
{
|
||||
readonly attribute DOMString target;
|
||||
};
|
||||
29
dom/interfaces/core/nsIDOMText.idl
Normal file
29
dom/interfaces/core/nsIDOMText.idl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- 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 "nsIDOMCharacterData.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMText interface inherits from nsIDOMCharacterData and represents
|
||||
* the textual content (termed character data in XML) of an Element or Attr.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[uuid(67273994-6aff-4091-9de9-b788a249f783)]
|
||||
interface nsIDOMText : nsIDOMCharacterData
|
||||
{
|
||||
nsIDOMText splitText(in unsigned long offset)
|
||||
raises(DOMException);
|
||||
|
||||
/**
|
||||
* The concatenation of all logically adjacent text nodes with this text
|
||||
* node, where "logically adjacent" consists of all text nodes which can be
|
||||
* reached by traversing the document tree in either direction without
|
||||
* passing an element, comment, or processing-instruction boundary.
|
||||
*/
|
||||
readonly attribute DOMString wholeText;
|
||||
};
|
||||
15
dom/interfaces/core/nsIDOMXMLDocument.idl
Normal file
15
dom/interfaces/core/nsIDOMXMLDocument.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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"
|
||||
|
||||
// The only reason this interface still exists is that we have addon and Firefox
|
||||
// code QIing to it and using it for instanceof via Components.interfaces, and
|
||||
// the interface needs to exist in order for the shim stuff in
|
||||
// xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp to work.
|
||||
[uuid(89ab39cb-c568-4d85-bd34-306d5cd5164d)]
|
||||
interface nsIDOMXMLDocument : nsISupports
|
||||
{
|
||||
};
|
||||
34
dom/interfaces/css/moz.build
Normal file
34
dom/interfaces/css/moz.build
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMCounter.idl',
|
||||
'nsIDOMCSSConditionRule.idl',
|
||||
'nsIDOMCSSCounterStyleRule.idl',
|
||||
'nsIDOMCSSFontFaceRule.idl',
|
||||
'nsIDOMCSSFontFeatureValuesRule.idl',
|
||||
'nsIDOMCSSGroupingRule.idl',
|
||||
'nsIDOMCSSImportRule.idl',
|
||||
'nsIDOMCSSKeyframeRule.idl',
|
||||
'nsIDOMCSSKeyframesRule.idl',
|
||||
'nsIDOMCSSMediaRule.idl',
|
||||
'nsIDOMCSSMozDocumentRule.idl',
|
||||
'nsIDOMCSSPageRule.idl',
|
||||
'nsIDOMCSSPrimitiveValue.idl',
|
||||
'nsIDOMCSSRule.idl',
|
||||
'nsIDOMCSSRuleList.idl',
|
||||
'nsIDOMCSSStyleDeclaration.idl',
|
||||
'nsIDOMCSSStyleRule.idl',
|
||||
'nsIDOMCSSStyleSheet.idl',
|
||||
'nsIDOMCSSSupportsRule.idl',
|
||||
'nsIDOMCSSUnknownRule.idl',
|
||||
'nsIDOMCSSValue.idl',
|
||||
'nsIDOMCSSValueList.idl',
|
||||
'nsIDOMRect.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_css'
|
||||
|
||||
16
dom/interfaces/css/nsIDOMCSSConditionRule.idl
Normal file
16
dom/interfaces/css/nsIDOMCSSConditionRule.idl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* -*- 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 "nsIDOMCSSGroupingRule.idl"
|
||||
|
||||
/**
|
||||
* Interface in the CSS OM for at-rules that conditionally apply their
|
||||
* child rules.
|
||||
*/
|
||||
[scriptable, uuid(44da41b2-5660-415d-8692-eae805776103)]
|
||||
interface nsIDOMCSSConditionRule : nsIDOMCSSGroupingRule
|
||||
{
|
||||
attribute DOMString conditionText;
|
||||
};
|
||||
23
dom/interfaces/css/nsIDOMCSSCounterStyleRule.idl
Normal file
23
dom/interfaces/css/nsIDOMCSSCounterStyleRule.idl
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(9b5e48ce-d84c-4e31-aff5-34e9f4141313)]
|
||||
interface nsIDOMCSSCounterStyleRule : nsIDOMCSSRule
|
||||
{
|
||||
attribute DOMString name;
|
||||
attribute DOMString system;
|
||||
attribute DOMString symbols;
|
||||
attribute DOMString additiveSymbols;
|
||||
attribute DOMString negative;
|
||||
attribute DOMString prefix;
|
||||
attribute DOMString suffix;
|
||||
attribute DOMString range;
|
||||
attribute DOMString pad;
|
||||
attribute DOMString speakAs;
|
||||
attribute DOMString fallback;
|
||||
};
|
||||
12
dom/interfaces/css/nsIDOMCSSFontFaceRule.idl
Normal file
12
dom/interfaces/css/nsIDOMCSSFontFaceRule.idl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(db971017-fe0c-4529-972c-8217f2fee217)]
|
||||
interface nsIDOMCSSFontFaceRule : nsIDOMCSSRule
|
||||
{
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
||||
16
dom/interfaces/css/nsIDOMCSSFontFeatureValuesRule.idl
Normal file
16
dom/interfaces/css/nsIDOMCSSFontFeatureValuesRule.idl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(a343d27f-1da6-4fc3-9355-d4ca434f958e)]
|
||||
interface nsIDOMCSSFontFeatureValuesRule : nsIDOMCSSRule
|
||||
{
|
||||
attribute DOMString fontFamily;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
attribute DOMString valueText;
|
||||
// raises(DOMException) on setting
|
||||
};
|
||||
21
dom/interfaces/css/nsIDOMCSSGroupingRule.idl
Normal file
21
dom/interfaces/css/nsIDOMCSSGroupingRule.idl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
/**
|
||||
* Interface for at-rules that have child rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(a0e3324a-f911-4baf-9591-5322c76cbb0d)]
|
||||
interface nsIDOMCSSGroupingRule : nsIDOMCSSRule
|
||||
{
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
unsigned long insertRule(in DOMString rule,
|
||||
in unsigned long index)
|
||||
raises(DOMException);
|
||||
void deleteRule(in unsigned long index)
|
||||
raises(DOMException);
|
||||
};
|
||||
14
dom/interfaces/css/nsIDOMCSSImportRule.idl
Normal file
14
dom/interfaces/css/nsIDOMCSSImportRule.idl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(d3b2b914-01ef-4663-beda-a6475a26f491)]
|
||||
interface nsIDOMCSSImportRule : nsIDOMCSSRule
|
||||
{
|
||||
readonly attribute DOMString href;
|
||||
readonly attribute nsIDOMMediaList media;
|
||||
readonly attribute nsIDOMCSSStyleSheet styleSheet;
|
||||
};
|
||||
13
dom/interfaces/css/nsIDOMCSSKeyframeRule.idl
Normal file
13
dom/interfaces/css/nsIDOMCSSKeyframeRule.idl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(a281a8b4-eaa2-49a8-8b97-acc2814a57c9)]
|
||||
interface nsIDOMCSSKeyframeRule : nsIDOMCSSRule
|
||||
{
|
||||
attribute DOMString keyText;
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
||||
17
dom/interfaces/css/nsIDOMCSSKeyframesRule.idl
Normal file
17
dom/interfaces/css/nsIDOMCSSKeyframesRule.idl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(400f4b70-ad0a-4047-aba4-ee8019f6b907)]
|
||||
interface nsIDOMCSSKeyframesRule : nsIDOMCSSRule
|
||||
{
|
||||
attribute DOMString name;
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
void appendRule(in DOMString rule);
|
||||
void deleteRule(in DOMString key);
|
||||
nsIDOMCSSKeyframeRule findRule(in DOMString key);
|
||||
};
|
||||
15
dom/interfaces/css/nsIDOMCSSMediaRule.idl
Normal file
15
dom/interfaces/css/nsIDOMCSSMediaRule.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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 "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
/**
|
||||
* Interface for @media rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(6cf9c5b2-fa0f-43c0-aa50-ef85b4756e3a)]
|
||||
interface nsIDOMCSSMediaRule : nsIDOMCSSConditionRule
|
||||
{
|
||||
readonly attribute nsIDOMMediaList media;
|
||||
};
|
||||
15
dom/interfaces/css/nsIDOMCSSMozDocumentRule.idl
Normal file
15
dom/interfaces/css/nsIDOMCSSMozDocumentRule.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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 "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
/**
|
||||
* Interface for @-moz-document rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(2d0cef9d-c1b2-4c6c-9003-fa83040626d1)]
|
||||
interface nsIDOMCSSMozDocumentRule : nsIDOMCSSConditionRule
|
||||
{
|
||||
// XXX Add access to the URL list.
|
||||
};
|
||||
15
dom/interfaces/css/nsIDOMCSSPageRule.idl
Normal file
15
dom/interfaces/css/nsIDOMCSSPageRule.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(c119072b-7d2f-4aeb-a90d-e2d6b606c32a)]
|
||||
interface nsIDOMCSSPageRule : nsIDOMCSSRule
|
||||
{
|
||||
//attribute DOMString selectorText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
||||
62
dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
Normal file
62
dom/interfaces/css/nsIDOMCSSPrimitiveValue.idl
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* -*- 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 "nsIDOMCSSValue.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSPrimitiveValue interface is a datatype for a primitive
|
||||
* CSS value in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(f6df7293-2dc9-4cb9-9531-778caf4370e0)]
|
||||
interface nsIDOMCSSPrimitiveValue : nsIDOMCSSValue
|
||||
{
|
||||
// UnitTypes
|
||||
const unsigned short CSS_UNKNOWN = 0;
|
||||
const unsigned short CSS_NUMBER = 1;
|
||||
const unsigned short CSS_PERCENTAGE = 2;
|
||||
const unsigned short CSS_EMS = 3;
|
||||
const unsigned short CSS_EXS = 4;
|
||||
const unsigned short CSS_PX = 5;
|
||||
const unsigned short CSS_CM = 6;
|
||||
const unsigned short CSS_MM = 7;
|
||||
const unsigned short CSS_IN = 8;
|
||||
const unsigned short CSS_PT = 9;
|
||||
const unsigned short CSS_PC = 10;
|
||||
const unsigned short CSS_DEG = 11;
|
||||
const unsigned short CSS_RAD = 12;
|
||||
const unsigned short CSS_GRAD = 13;
|
||||
const unsigned short CSS_MS = 14;
|
||||
const unsigned short CSS_S = 15;
|
||||
const unsigned short CSS_HZ = 16;
|
||||
const unsigned short CSS_KHZ = 17;
|
||||
const unsigned short CSS_DIMENSION = 18;
|
||||
const unsigned short CSS_STRING = 19;
|
||||
const unsigned short CSS_URI = 20;
|
||||
const unsigned short CSS_IDENT = 21;
|
||||
const unsigned short CSS_ATTR = 22;
|
||||
const unsigned short CSS_COUNTER = 23;
|
||||
const unsigned short CSS_RECT = 24;
|
||||
const unsigned short CSS_RGBCOLOR = 25;
|
||||
|
||||
readonly attribute unsigned short primitiveType;
|
||||
void setFloatValue(in unsigned short unitType,
|
||||
in float floatValue)
|
||||
raises(DOMException);
|
||||
float getFloatValue(in unsigned short unitType)
|
||||
raises(DOMException);
|
||||
void setStringValue(in unsigned short stringType,
|
||||
in DOMString stringValue)
|
||||
raises(DOMException);
|
||||
DOMString getStringValue()
|
||||
raises(DOMException);
|
||||
nsIDOMCounter getCounterValue()
|
||||
raises(DOMException);
|
||||
nsIDOMRect getRectValue()
|
||||
raises(DOMException);
|
||||
};
|
||||
56
dom/interfaces/css/nsIDOMCSSRule.idl
Normal file
56
dom/interfaces/css/nsIDOMCSSRule.idl
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/* -*- 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"
|
||||
|
||||
%{C++
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class Rule;
|
||||
}
|
||||
}
|
||||
%}
|
||||
|
||||
[ptr] native Rule(mozilla::css::Rule);
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSRule interface is a datatype for a CSS style rule in
|
||||
* the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[scriptable, uuid(4d6b3bad-f53c-4585-82f6-62982e27ede8)]
|
||||
interface nsIDOMCSSRule : nsISupports
|
||||
{
|
||||
// RuleType
|
||||
const unsigned short UNKNOWN_RULE = 0;
|
||||
const unsigned short STYLE_RULE = 1;
|
||||
const unsigned short CHARSET_RULE = 2;
|
||||
const unsigned short IMPORT_RULE = 3;
|
||||
const unsigned short MEDIA_RULE = 4;
|
||||
const unsigned short FONT_FACE_RULE = 5;
|
||||
const unsigned short PAGE_RULE = 6;
|
||||
const unsigned short KEYFRAMES_RULE = 7;
|
||||
const unsigned short KEYFRAME_RULE = 8;
|
||||
// When layout.css.prefixes.animations is disabled/removed,
|
||||
// we should remove these two MOZ_* constants.
|
||||
const unsigned short MOZ_KEYFRAMES_RULE = 7;
|
||||
const unsigned short MOZ_KEYFRAME_RULE = 8;
|
||||
const unsigned short NAMESPACE_RULE = 10;
|
||||
const unsigned short COUNTER_STYLE_RULE = 11;
|
||||
const unsigned short SUPPORTS_RULE = 12;
|
||||
const unsigned short FONT_FEATURE_VALUES_RULE = 14;
|
||||
|
||||
readonly attribute unsigned short type;
|
||||
attribute DOMString cssText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute nsIDOMCSSStyleSheet parentStyleSheet;
|
||||
readonly attribute nsIDOMCSSRule parentRule;
|
||||
|
||||
[noscript, nostdcall, notxpcom] Rule getCSSRule();
|
||||
};
|
||||
21
dom/interfaces/css/nsIDOMCSSRuleList.idl
Normal file
21
dom/interfaces/css/nsIDOMCSSRuleList.idl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSRuleList interface is a datatype for a list of CSS
|
||||
* style rules in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[scriptable, uuid(a6cf90c0-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMCSSRuleList : nsISupports
|
||||
{
|
||||
readonly attribute unsigned long length;
|
||||
nsIDOMCSSRule item(in unsigned long index);
|
||||
};
|
||||
34
dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
Normal file
34
dom/interfaces/css/nsIDOMCSSStyleDeclaration.idl
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSStyleDeclaration interface is a datatype for a CSS
|
||||
* style declaration in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(a6cf90be-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMCSSStyleDeclaration : nsISupports
|
||||
{
|
||||
attribute DOMString cssText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
DOMString getPropertyValue(in DOMString propertyName);
|
||||
nsIDOMCSSValue getPropertyCSSValue(in DOMString propertyName);
|
||||
DOMString removeProperty(in DOMString propertyName)
|
||||
raises(DOMException);
|
||||
DOMString getPropertyPriority(in DOMString propertyName);
|
||||
void setProperty(in DOMString propertyName,
|
||||
in DOMString value,
|
||||
[optional] in DOMString priority)
|
||||
raises(DOMException);
|
||||
readonly attribute unsigned long length;
|
||||
DOMString item(in unsigned long index);
|
||||
readonly attribute nsIDOMCSSRule parentRule;
|
||||
};
|
||||
15
dom/interfaces/css/nsIDOMCSSStyleRule.idl
Normal file
15
dom/interfaces/css/nsIDOMCSSStyleRule.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(b5e9af48-a7c2-4f88-aae3-58307af4b5a5)]
|
||||
interface nsIDOMCSSStyleRule : nsIDOMCSSRule
|
||||
{
|
||||
attribute DOMString selectorText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute nsIDOMCSSStyleDeclaration style;
|
||||
};
|
||||
27
dom/interfaces/css/nsIDOMCSSStyleSheet.idl
Normal file
27
dom/interfaces/css/nsIDOMCSSStyleSheet.idl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* -*- 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 "nsIDOMStyleSheet.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSStyleSheet interface is a datatype for a CSS style
|
||||
* sheet in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(a6cf90c2-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMCSSStyleSheet : nsIDOMStyleSheet
|
||||
{
|
||||
readonly attribute nsIDOMCSSRule ownerRule;
|
||||
readonly attribute nsIDOMCSSRuleList cssRules;
|
||||
|
||||
unsigned long insertRule(in DOMString rule,
|
||||
in unsigned long index)
|
||||
raises(DOMException);
|
||||
void deleteRule(in unsigned long index)
|
||||
raises(DOMException);
|
||||
};
|
||||
14
dom/interfaces/css/nsIDOMCSSSupportsRule.idl
Normal file
14
dom/interfaces/css/nsIDOMCSSSupportsRule.idl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- 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 "nsIDOMCSSConditionRule.idl"
|
||||
|
||||
/**
|
||||
* Interface for @supports rules in the CSS OM.
|
||||
*/
|
||||
[scriptable, uuid(0b9e63a1-1bd7-4caf-850e-148b762b14d2)]
|
||||
interface nsIDOMCSSSupportsRule : nsIDOMCSSConditionRule
|
||||
{
|
||||
};
|
||||
11
dom/interfaces/css/nsIDOMCSSUnknownRule.idl
Normal file
11
dom/interfaces/css/nsIDOMCSSUnknownRule.idl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/* -*- 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 "nsIDOMCSSRule.idl"
|
||||
|
||||
[scriptable, uuid(98f4c27b-fb35-4355-8fd9-546c4697d71a)]
|
||||
interface nsIDOMCSSUnknownRule : nsIDOMCSSRule
|
||||
{
|
||||
};
|
||||
29
dom/interfaces/css/nsIDOMCSSValue.idl
Normal file
29
dom/interfaces/css/nsIDOMCSSValue.idl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMCSSValue interface is a datatype for a CSS value in the
|
||||
* Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Style
|
||||
*/
|
||||
|
||||
[uuid(009f7ea5-9e80-41be-b008-db62f10823f2)]
|
||||
interface nsIDOMCSSValue : nsISupports
|
||||
{
|
||||
// UnitTypes
|
||||
const unsigned short CSS_INHERIT = 0;
|
||||
const unsigned short CSS_PRIMITIVE_VALUE = 1;
|
||||
const unsigned short CSS_VALUE_LIST = 2;
|
||||
const unsigned short CSS_CUSTOM = 3;
|
||||
|
||||
attribute DOMString cssText;
|
||||
// raises(DOMException) on setting
|
||||
|
||||
readonly attribute unsigned short cssValueType;
|
||||
};
|
||||
12
dom/interfaces/css/nsIDOMCSSValueList.idl
Normal file
12
dom/interfaces/css/nsIDOMCSSValueList.idl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* -*- 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"
|
||||
#include "nsIDOMCSSValue.idl"
|
||||
|
||||
[uuid(92364ed1-e364-4175-bc52-c2fe9671cbc7)]
|
||||
interface nsIDOMCSSValueList : nsIDOMCSSValue
|
||||
{
|
||||
};
|
||||
14
dom/interfaces/css/nsIDOMCounter.idl
Normal file
14
dom/interfaces/css/nsIDOMCounter.idl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- 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(31adb439-0055-402d-9b1d-d5ca94f3f55b)]
|
||||
interface nsIDOMCounter : nsISupports
|
||||
{
|
||||
readonly attribute DOMString identifier;
|
||||
readonly attribute DOMString listStyle;
|
||||
readonly attribute DOMString separator;
|
||||
};
|
||||
15
dom/interfaces/css/nsIDOMRect.idl
Normal file
15
dom/interfaces/css/nsIDOMRect.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- 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"
|
||||
|
||||
[uuid(71735f62-ac5c-4236-9a1f-5ffb280d531c)]
|
||||
interface nsIDOMRect : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMCSSPrimitiveValue top;
|
||||
readonly attribute nsIDOMCSSPrimitiveValue right;
|
||||
readonly attribute nsIDOMCSSPrimitiveValue bottom;
|
||||
readonly attribute nsIDOMCSSPrimitiveValue left;
|
||||
};
|
||||
35
dom/interfaces/events/moz.build
Normal file
35
dom/interfaces/events/moz.build
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMAnimationEvent.idl',
|
||||
'nsIDOMBeforeUnloadEvent.idl',
|
||||
'nsIDOMClipboardEvent.idl',
|
||||
'nsIDOMCommandEvent.idl',
|
||||
'nsIDOMCustomEvent.idl',
|
||||
'nsIDOMDataContainerEvent.idl',
|
||||
'nsIDOMDataTransfer.idl',
|
||||
'nsIDOMDragEvent.idl',
|
||||
'nsIDOMEvent.idl',
|
||||
'nsIDOMEventListener.idl',
|
||||
'nsIDOMEventTarget.idl',
|
||||
'nsIDOMFocusEvent.idl',
|
||||
'nsIDOMKeyEvent.idl',
|
||||
'nsIDOMMouseEvent.idl',
|
||||
'nsIDOMMouseScrollEvent.idl',
|
||||
'nsIDOMMutationEvent.idl',
|
||||
'nsIDOMNotifyPaintEvent.idl',
|
||||
'nsIDOMNSEvent.idl',
|
||||
'nsIDOMPaintRequest.idl',
|
||||
'nsIDOMScrollAreaEvent.idl',
|
||||
'nsIDOMSimpleGestureEvent.idl',
|
||||
'nsIDOMTransitionEvent.idl',
|
||||
'nsIDOMUIEvent.idl',
|
||||
'nsIDOMWheelEvent.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_events'
|
||||
|
||||
20
dom/interfaces/events/nsIDOMAnimationEvent.idl
Normal file
20
dom/interfaces/events/nsIDOMAnimationEvent.idl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* 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 "nsISupports.idl"
|
||||
|
||||
/**
|
||||
* Animation events are defined in:
|
||||
* http://www.w3.org/TR/css3-animations/#animation-events-
|
||||
* http://dev.w3.org/csswg/css3-animations/#animation-events-
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(ce6d1db3-53b8-4ade-9baa-70f4947200a2)]
|
||||
interface nsIDOMAnimationEvent : nsISupports
|
||||
{
|
||||
readonly attribute DOMString animationName;
|
||||
readonly attribute float elapsedTime;
|
||||
readonly attribute DOMString pseudoElement;
|
||||
};
|
||||
26
dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl
Normal file
26
dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMBeforeUnloadEvent interface is the interface for events
|
||||
* sent to handlers of the "beforeunload" event. This event is
|
||||
* non-standard. Interface derived from Microsoft IE's event
|
||||
* implementation.
|
||||
*
|
||||
* http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events.asp
|
||||
*
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(26c83933-a5a4-455e-8c46-69fa24dfa991)]
|
||||
interface nsIDOMBeforeUnloadEvent : nsISupports
|
||||
{
|
||||
/**
|
||||
* Attribute used to pass back a return value from a beforeunload
|
||||
* handler
|
||||
*/
|
||||
attribute DOMString returnValue;
|
||||
};
|
||||
22
dom/interfaces/events/nsIDOMClipboardEvent.idl
Normal file
22
dom/interfaces/events/nsIDOMClipboardEvent.idl
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* -*- Mode: C++; 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"
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMDataTransfer;
|
||||
|
||||
[builtinclass, uuid(b54d6144-3980-4895-83c7-82f158bc1cf5)]
|
||||
interface nsIDOMClipboardEvent : nsISupports
|
||||
{
|
||||
readonly attribute nsIDOMDataTransfer clipboardData;
|
||||
|
||||
// The constructor must be used from script to initialize
|
||||
// clipboard events.
|
||||
[noscript] void initClipboardEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMDataTransfer clipboardData);
|
||||
};
|
||||
17
dom/interfaces/events/nsIDOMCommandEvent.idl
Normal file
17
dom/interfaces/events/nsIDOMCommandEvent.idl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* -*- 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"
|
||||
|
||||
[builtinclass, uuid(73a50e55-3eaa-4a38-a588-9b68a6d65032)]
|
||||
interface nsIDOMCommandEvent : nsISupports
|
||||
{
|
||||
readonly attribute DOMString command;
|
||||
|
||||
void initCommandEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean canCancelArg,
|
||||
in DOMString command);
|
||||
};
|
||||
19
dom/interfaces/events/nsIDOMCustomEvent.idl
Normal file
19
dom/interfaces/events/nsIDOMCustomEvent.idl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* 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 "nsISupports.idl"
|
||||
interface nsIVariant;
|
||||
|
||||
[builtinclass, uuid(5be16b03-36f9-4ca8-b2c5-0daadf3cd1b3)]
|
||||
interface nsIDOMCustomEvent : nsISupports
|
||||
{
|
||||
|
||||
readonly attribute nsIVariant detail;
|
||||
|
||||
void initCustomEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIVariant detailArg);
|
||||
};
|
||||
30
dom/interfaces/events/nsIDOMDataContainerEvent.idl
Normal file
30
dom/interfaces/events/nsIDOMDataContainerEvent.idl
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* -*- Mode: C++; 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"
|
||||
#include "nsIVariant.idl"
|
||||
|
||||
[builtinclass, uuid(a9f1f528-d106-4fea-8663-2d7f64b627a9)]
|
||||
interface nsIDOMDataContainerEvent : nsISupports
|
||||
{
|
||||
/**
|
||||
* Return the data associated with the given key.
|
||||
*
|
||||
* @param key the key
|
||||
* @return the data associated with the key
|
||||
*/
|
||||
nsIVariant getData(in DOMString key);
|
||||
|
||||
/**
|
||||
* Set the data for the given key.
|
||||
*
|
||||
* @param key the data key
|
||||
* @param data the data
|
||||
* @throws NS_ERROR_UNEXPECTED if the method is called during event
|
||||
* dispatch
|
||||
*/
|
||||
void setData(in DOMString key, in nsIVariant data);
|
||||
};
|
||||
|
||||
150
dom/interfaces/events/nsIDOMDataTransfer.idl
Normal file
150
dom/interfaces/events/nsIDOMDataTransfer.idl
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
/* -*- Mode: C++; 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 nsIVariant;
|
||||
interface nsIDOMFileList;
|
||||
|
||||
[builtinclass, uuid(655078bf-1675-4aa0-a48d-a133e864ce57)]
|
||||
interface nsIDOMDataTransfer : nsISupports
|
||||
{
|
||||
/**
|
||||
* The actual effect that will be used, and should always be one of the
|
||||
* possible values of effectAllowed.
|
||||
*
|
||||
* For dragstart, drag and dragleave events, the dropEffect is initialized
|
||||
* to none. Any value assigned to the dropEffect will be set, but the value
|
||||
* isn't used for anything.
|
||||
*
|
||||
* For the dragenter and dragover events, the dropEffect will be initialized
|
||||
* based on what action the user is requesting. How this is determined is
|
||||
* platform specific, but typically the user can press modifier keys to
|
||||
* adjust which action is desired. Within an event handler for the dragenter
|
||||
* and dragover events, the dropEffect should be modified if the action the
|
||||
* user is requesting is not the one that is desired.
|
||||
*
|
||||
* For the drop and dragend events, the dropEffect will be initialized to
|
||||
* the action that was desired, which will be the value that the dropEffect
|
||||
* had after the last dragenter or dragover event.
|
||||
*
|
||||
* Possible values:
|
||||
* copy - a copy of the source item is made at the new location
|
||||
* move - an item is moved to a new location
|
||||
* link - a link is established to the source at the new location
|
||||
* none - the item may not be dropped
|
||||
*
|
||||
* Assigning any other value has no effect and retains the old value.
|
||||
*/
|
||||
attribute DOMString dropEffect;
|
||||
|
||||
/*
|
||||
* Specifies the effects that are allowed for this drag. You may set this in
|
||||
* the dragstart event to set the desired effects for the source, and within
|
||||
* the dragenter and dragover events to set the desired effects for the
|
||||
* target. The value is not used for other events.
|
||||
*
|
||||
* Possible values:
|
||||
* copy - a copy of the source item is made at the new location
|
||||
* move - an item is moved to a new location
|
||||
* link - a link is established to the source at the new location
|
||||
* copyLink, copyMove, linkMove, all - combinations of the above
|
||||
* none - the item may not be dropped
|
||||
* uninitialized - the default value when the effect has not been set,
|
||||
* equivalent to all.
|
||||
*
|
||||
* Assigning any other value has no effect and retains the old value.
|
||||
*/
|
||||
attribute DOMString effectAllowed;
|
||||
|
||||
/**
|
||||
* Holds a list of all the local files available on this data transfer.
|
||||
* A dataTransfer containing no files will return an empty list, and an
|
||||
* invalid index access on the resulting file list will return null.
|
||||
*/
|
||||
readonly attribute nsIDOMFileList files;
|
||||
|
||||
/**
|
||||
* Set the image to be used for dragging if a custom one is desired. Most of
|
||||
* the time, this would not be set, as a default image is created from the
|
||||
* node that was dragged.
|
||||
*
|
||||
* If the node is an HTML img element, an HTML canvas element or a XUL image
|
||||
* element, the image data is used. Otherwise, image should be a visible
|
||||
* node and the drag image will be created from this. If image is null, any
|
||||
* custom drag image is cleared and the default is used instead.
|
||||
*
|
||||
* The coordinates specify the offset into the image where the mouse cursor
|
||||
* should be. To center the image for instance, use values that are half the
|
||||
* width and height.
|
||||
*
|
||||
* @param image a node to use
|
||||
* @param x the horizontal offset
|
||||
* @param y the vertical offset
|
||||
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
|
||||
*/
|
||||
void setDragImage(in nsIDOMElement image, in long x, in long y);
|
||||
|
||||
/*
|
||||
* Set the drag source. Usually you would not change this, but it will
|
||||
* affect which node the drag and dragend events are fired at. The
|
||||
* default target is the node that was dragged.
|
||||
*
|
||||
* @param element drag source to use
|
||||
* @throws NO_MODIFICATION_ALLOWED_ERR if the item cannot be modified
|
||||
*/
|
||||
void addElement(in nsIDOMElement element);
|
||||
|
||||
/**
|
||||
* The number of items being dragged.
|
||||
*/
|
||||
readonly attribute unsigned long mozItemCount;
|
||||
|
||||
/**
|
||||
* Sets the drag cursor state. Primarily used to control the cursor during
|
||||
* tab drags, but could be expanded to other uses. XXX Currently implemented
|
||||
* on Win32 only.
|
||||
*
|
||||
* Possible values:
|
||||
* auto - use default system behavior.
|
||||
* default - set the cursor to an arrow during the drag operation.
|
||||
*
|
||||
* Values other than 'default' are indentical to setting mozCursor to
|
||||
* 'auto'.
|
||||
*/
|
||||
attribute DOMString mozCursor;
|
||||
|
||||
/**
|
||||
* Holds a list of the format types of the data that is stored for an item
|
||||
* at the specified index. If the index is not in the range from 0 to
|
||||
* itemCount - 1, an empty string list is returned.
|
||||
*/
|
||||
nsISupports mozTypesAt(in unsigned long index);
|
||||
|
||||
/**
|
||||
* Will be true when the user has cancelled the drag (typically by pressing
|
||||
* Escape) and when the drag has been cancelled unexpectedly. This will be
|
||||
* false otherwise, including when the drop has been rejected by its target.
|
||||
* This property is only relevant for the dragend event.
|
||||
*/
|
||||
readonly attribute boolean mozUserCancelled;
|
||||
|
||||
/**
|
||||
* The node that the mouse was pressed over to begin the drag. For external
|
||||
* drags, or if the caller cannot access this node, this will be null.
|
||||
*/
|
||||
readonly attribute nsIDOMNode mozSourceNode;
|
||||
|
||||
/*
|
||||
* Integer version of dropEffect, set to one of the constants in nsIDragService.
|
||||
*/
|
||||
[noscript] attribute unsigned long dropEffectInt;
|
||||
|
||||
/*
|
||||
* Integer version of effectAllowed, set to one or a combination of the
|
||||
* constants in nsIDragService.
|
||||
*/
|
||||
[noscript] attribute unsigned long effectAllowedInt;
|
||||
};
|
||||
15
dom/interfaces/events/nsIDOMDragEvent.idl
Normal file
15
dom/interfaces/events/nsIDOMDragEvent.idl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* -*- Mode: C++; 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"
|
||||
#include "nsIDOMMouseEvent.idl"
|
||||
|
||||
interface nsIDOMDataTransfer;
|
||||
|
||||
[builtinclass, uuid(d5c0d4c2-c646-4b4b-836e-48408b9c7b80)]
|
||||
interface nsIDOMDragEvent : nsIDOMMouseEvent
|
||||
{
|
||||
readonly attribute nsIDOMDataTransfer dataTransfer;
|
||||
};
|
||||
221
dom/interfaces/events/nsIDOMEvent.idl
Normal file
221
dom/interfaces/events/nsIDOMEvent.idl
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
/* -*- 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 nsIDOMEventTarget;
|
||||
|
||||
[ptr] native WidgetEvent(mozilla::WidgetEvent);
|
||||
[ptr] native DOMEventPtr(mozilla::dom::Event);
|
||||
[ptr] native IPCMessagePtr(IPC::Message);
|
||||
[ptr] native ConstIPCMessagePtr(const IPC::Message);
|
||||
[ptr] native PickleIterator(PickleIterator);
|
||||
[ptr] native EventTargetPtr(mozilla::dom::EventTarget);
|
||||
%{C++
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
|
||||
#include "mozilla/EventForwards.h"
|
||||
class nsPresContext;
|
||||
class nsInvalidateRequestList;
|
||||
namespace IPC {
|
||||
class Message;
|
||||
}
|
||||
class PickleIterator;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class Event;
|
||||
class EventTarget;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
%}
|
||||
|
||||
/**
|
||||
* The nsIDOMEvent interface is the primary datatype for all events in
|
||||
* the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html and
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(f58daacf-4d1a-4002-8fd7-06b614dfbcf6)]
|
||||
interface nsIDOMEvent : nsISupports
|
||||
{
|
||||
// PhaseType
|
||||
/**
|
||||
* The event isn't being dispatched.
|
||||
*/
|
||||
const unsigned short NONE = 0;
|
||||
/**
|
||||
* The current event phase is the capturing phase.
|
||||
*/
|
||||
const unsigned short CAPTURING_PHASE = 1;
|
||||
|
||||
/**
|
||||
* The event is currently being evaluated at the target EventTarget.
|
||||
*/
|
||||
const unsigned short AT_TARGET = 2;
|
||||
|
||||
/**
|
||||
* The current event phase is the bubbling phase.
|
||||
*/
|
||||
const unsigned short BUBBLING_PHASE = 3;
|
||||
|
||||
/**
|
||||
* The name of the event (case-insensitive). The name must be an XML
|
||||
* name.
|
||||
*/
|
||||
readonly attribute DOMString type;
|
||||
|
||||
/**
|
||||
* Used to indicate the EventTarget to which the event was originally
|
||||
* dispatched.
|
||||
*/
|
||||
readonly attribute nsIDOMEventTarget target;
|
||||
|
||||
/**
|
||||
* Used to indicate the EventTarget whose EventListeners are currently
|
||||
* being processed. This is particularly useful during capturing and
|
||||
* bubbling.
|
||||
*/
|
||||
readonly attribute nsIDOMEventTarget currentTarget;
|
||||
|
||||
/**
|
||||
* Used to indicate which phase of event flow is currently being
|
||||
* evaluated.
|
||||
*/
|
||||
readonly attribute unsigned short eventPhase;
|
||||
|
||||
/**
|
||||
* Used to indicate whether or not an event is a bubbling event. If the
|
||||
* event can bubble the value is true, else the value is false.
|
||||
*/
|
||||
readonly attribute boolean bubbles;
|
||||
|
||||
/**
|
||||
* Used to indicate whether or not an event can have its default action
|
||||
* prevented. If the default action can be prevented the value is true,
|
||||
* else the value is false.
|
||||
*/
|
||||
readonly attribute boolean cancelable;
|
||||
|
||||
/**
|
||||
* Used to specify the time (in milliseconds relative to the epoch) at
|
||||
* which the event was created. Due to the fact that some systems may
|
||||
* not provide this information the value of timeStamp may be not
|
||||
* available for all events. When not available, a value of 0 will be
|
||||
* returned. Examples of epoch time are the time of the system start or
|
||||
* 0:0:0 UTC 1st January 1970.
|
||||
*/
|
||||
readonly attribute DOMTimeStamp timeStamp;
|
||||
|
||||
/**
|
||||
* The stopPropagation method is used prevent further propagation of an
|
||||
* event during event flow. If this method is called by any
|
||||
* EventListener the event will cease propagating through the tree. The
|
||||
* event will complete dispatch to all listeners on the current
|
||||
* EventTarget before event flow stops. This method may be used during
|
||||
* any stage of event flow.
|
||||
*/
|
||||
void stopPropagation();
|
||||
|
||||
/**
|
||||
* If an event is cancelable, the preventDefault method is used to
|
||||
* signify that the event is to be canceled, meaning any default action
|
||||
* normally taken by the implementation as a result of the event will
|
||||
* not occur. If, during any stage of event flow, the preventDefault
|
||||
* method is called the event is canceled. Any default action associated
|
||||
* with the event will not occur. Calling this method for a
|
||||
* non-cancelable event has no effect. Once preventDefault has been
|
||||
* called it will remain in effect throughout the remainder of the
|
||||
* event's propagation. This method may be used during any stage of
|
||||
* event flow.
|
||||
*/
|
||||
void preventDefault();
|
||||
|
||||
/**
|
||||
* The initEvent method is used to initialize the value of an Event
|
||||
* created through the DocumentEvent interface. This method may only be
|
||||
* called before the Event has been dispatched via the dispatchEvent
|
||||
* method, though it may be called multiple times during that phase if
|
||||
* necessary. If called multiple times the final invocation takes
|
||||
* precedence. If called from a subclass of Event interface only the
|
||||
* values specified in the initEvent method are modified, all other
|
||||
* attributes are left unchanged.
|
||||
*
|
||||
* @param eventTypeArg Specifies the event type. This type may be
|
||||
* any event type currently defined in this
|
||||
* specification or a new event type.. The string
|
||||
* must be an XML name.
|
||||
* Any new event type must not begin with any
|
||||
* upper, lower, or mixed case version of the
|
||||
* string "DOM". This prefix is reserved for
|
||||
* future DOM event sets. It is also strongly
|
||||
* recommended that third parties adding their
|
||||
* own events use their own prefix to avoid
|
||||
* confusion and lessen the probability of
|
||||
* conflicts with other new events.
|
||||
* @param canBubbleArg Specifies whether or not the event can bubble.
|
||||
* @param cancelableArg Specifies whether or not the event's default
|
||||
* action can be prevented.
|
||||
*/
|
||||
[notxpcom,nostdcall]
|
||||
void initEvent(in DOMString eventTypeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg);
|
||||
|
||||
/**
|
||||
* Used to indicate whether preventDefault() has been called for this event.
|
||||
*/
|
||||
readonly attribute boolean defaultPrevented;
|
||||
|
||||
/**
|
||||
* Prevents other event listeners from being triggered and,
|
||||
* unlike Event.stopPropagation() its effect is immediate.
|
||||
*/
|
||||
void stopImmediatePropagation();
|
||||
|
||||
const long ALT_MASK = 0x00000001;
|
||||
const long CONTROL_MASK = 0x00000002;
|
||||
const long SHIFT_MASK = 0x00000004;
|
||||
const long META_MASK = 0x00000008;
|
||||
|
||||
/** The original target of the event, before any retargetings. */
|
||||
readonly attribute nsIDOMEventTarget originalTarget;
|
||||
/**
|
||||
* The explicit original target of the event. If the event was retargeted
|
||||
* for some reason other than an anonymous boundary crossing, this will be set
|
||||
* to the target before the retargeting occurs. For example, mouse events
|
||||
* are retargeted to their parent node when they happen over text nodes (bug
|
||||
* 185889), and in that case .target will show the parent and
|
||||
* .explicitOriginalTarget will show the text node.
|
||||
* .explicitOriginalTarget differs from .originalTarget in that it will never
|
||||
* contain anonymous content.
|
||||
*/
|
||||
readonly attribute nsIDOMEventTarget explicitOriginalTarget;
|
||||
|
||||
/**
|
||||
* @deprecated Use nsIDOMEvent::defaultPrevented.
|
||||
* To be removed in bug 691151.
|
||||
*/
|
||||
boolean getPreventDefault();
|
||||
|
||||
readonly attribute boolean isTrusted;
|
||||
attribute boolean cancelBubble;
|
||||
|
||||
[noscript] void duplicatePrivateData();
|
||||
[noscript] void setTarget(in nsIDOMEventTarget aTarget);
|
||||
[notxpcom] boolean IsDispatchStopped();
|
||||
[notxpcom] WidgetEvent WidgetEventPtr();
|
||||
[noscript,notxpcom] void SetTrusted(in boolean aTrusted);
|
||||
[notxpcom] void Serialize(in IPCMessagePtr aMsg,
|
||||
in boolean aSerializeInterfaceType);
|
||||
[notxpcom] boolean Deserialize(in ConstIPCMessagePtr aMsg, in PickleIterator aIter);
|
||||
[noscript,notxpcom] void SetOwner(in EventTargetPtr aOwner);
|
||||
[notxpcom] DOMEventPtr InternalDOMEvent();
|
||||
[noscript] void stopCrossProcessForwarding();
|
||||
};
|
||||
29
dom/interfaces/events/nsIDOMEventListener.idl
Normal file
29
dom/interfaces/events/nsIDOMEventListener.idl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- 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"
|
||||
|
||||
/**
|
||||
* The nsIDOMEventListener interface is a callback interface for
|
||||
* listening to events in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[scriptable, function, uuid(df31c120-ded6-11d1-bd85-00805f8ae3f4)]
|
||||
interface nsIDOMEventListener : nsISupports
|
||||
{
|
||||
/**
|
||||
* This method is called whenever an event occurs of the type for which
|
||||
* the EventListener interface was registered.
|
||||
*
|
||||
* @param evt The Event contains contextual information about the
|
||||
* event. It also contains the stopPropagation and
|
||||
* preventDefault methods which are used in determining the
|
||||
* event's flow and default action.
|
||||
*/
|
||||
void handleEvent(in nsIDOMEvent event);
|
||||
};
|
||||
304
dom/interfaces/events/nsIDOMEventTarget.idl
Normal file
304
dom/interfaces/events/nsIDOMEventTarget.idl
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
/* -*- 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"
|
||||
|
||||
%{C++
|
||||
#include "mozilla/EventForwards.h"
|
||||
#include "mozilla/dom/Nullable.h"
|
||||
#include "js/TypeDecls.h"
|
||||
|
||||
using mozilla::dom::Nullable;
|
||||
|
||||
namespace mozilla {
|
||||
class EventChainPostVisitor;
|
||||
class EventChainPreVisitor;
|
||||
class EventListenerManager;
|
||||
namespace dom {
|
||||
class EventTarget;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsPresContext;
|
||||
%}
|
||||
|
||||
/**
|
||||
* The nsIDOMEventTarget interface is the interface implemented by all
|
||||
* event targets in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[ptr] native WidgetEventPtr(mozilla::WidgetEvent);
|
||||
[ptr] native nsPresContextPtr(nsPresContext);
|
||||
[ptr] native nsEventStatusPtr(nsEventStatus);
|
||||
[ptr] native JSContextPtr(JSContext);
|
||||
[ref] native EventChainPostVisitorRef(mozilla::EventChainPostVisitor);
|
||||
[ref] native EventChainPreVisitorRef(mozilla::EventChainPreVisitor);
|
||||
[ptr] native EventListenerManagerPtr(mozilla::EventListenerManager);
|
||||
[ptr] native EventTargetPtr(mozilla::dom::EventTarget);
|
||||
|
||||
interface nsIScriptContext;
|
||||
interface nsIDOMEventListener;
|
||||
interface nsIDOMEvent;
|
||||
|
||||
[scriptable, builtinclass, uuid(9a78ac3c-9507-4d00-b2d6-10b508d2ec31)]
|
||||
interface nsIDOMEventTarget : nsISupports
|
||||
{
|
||||
/**
|
||||
* This method allows the registration of event listeners on the event target.
|
||||
* If an EventListener is added to an EventTarget while it is processing an
|
||||
* event, it will not be triggered by the current actions but may be
|
||||
* triggered during a later stage of event flow, such as the bubbling phase.
|
||||
*
|
||||
* If multiple identical EventListeners are registered on the same
|
||||
* EventTarget with the same parameters the duplicate instances are
|
||||
* discarded. They do not cause the EventListener to be called twice
|
||||
* and since they are discarded they do not need to be removed with the
|
||||
* removeEventListener method.
|
||||
*
|
||||
* @param type The event type for which the user is registering
|
||||
* @param listener The listener parameter takes an interface
|
||||
* implemented by the user which contains the methods
|
||||
* to be called when the event occurs.
|
||||
* @param useCapture If true, useCapture indicates that the user
|
||||
* wishes to initiate capture. After initiating
|
||||
* capture, all events of the specified type will be
|
||||
* dispatched to the registered EventListener before
|
||||
* being dispatched to any EventTargets beneath them
|
||||
* in the tree. Events which are bubbling upward
|
||||
* through the tree will not trigger an
|
||||
* EventListener designated to use capture.
|
||||
* @param wantsUntrusted If false, the listener will not receive any
|
||||
* untrusted events (see above), if true, the
|
||||
* listener will receive events whether or not
|
||||
* they're trusted
|
||||
*/
|
||||
[optional_argc] void addEventListener(in DOMString type,
|
||||
in nsIDOMEventListener listener,
|
||||
[optional] in boolean useCapture,
|
||||
[optional] in boolean wantsUntrusted);
|
||||
|
||||
/**
|
||||
* addSystemEventListener() adds an event listener of aType to the system
|
||||
* group. Typically, core code should use system group for listening to
|
||||
* content (i.e., non-chrome) element's events. If core code uses
|
||||
* nsIDOMEventTarget::AddEventListener for a content node, it means
|
||||
* that the listener cannot listen the event when web content calls
|
||||
* stopPropagation() of the event.
|
||||
*
|
||||
* @param aType An event name you're going to handle.
|
||||
* @param aListener An event listener.
|
||||
* @param aUseCapture TRUE if you want to listen the event in capturing
|
||||
* phase. Otherwise, FALSE.
|
||||
* @param aWantsUntrusted TRUE if you want to handle untrusted events.
|
||||
* Otherwise, FALSE.
|
||||
* @return NS_OK if succeed. Otherwise, NS_ERROR_*.
|
||||
*/
|
||||
[noscript, optional_argc] void addSystemEventListener(
|
||||
in DOMString type,
|
||||
in nsIDOMEventListener listener,
|
||||
[optional] in boolean aUseCapture,
|
||||
[optional] in boolean aWantsUntrusted);
|
||||
|
||||
%{C++
|
||||
// non-virtual so it won't affect the vtable
|
||||
nsresult AddEventListener(const nsAString& aType,
|
||||
nsIDOMEventListener* aListener,
|
||||
bool aUseCapture)
|
||||
{
|
||||
return AddEventListener(aType, aListener, aUseCapture, false, 1);
|
||||
}
|
||||
// non-virtual so it won't affect the vtable
|
||||
nsresult AddEventListener(const nsAString& aType,
|
||||
nsIDOMEventListener* aListener,
|
||||
bool aUseCapture,
|
||||
bool aWantsUntrusted)
|
||||
{
|
||||
return AddEventListener(aType, aListener, aUseCapture, aWantsUntrusted, 2);
|
||||
}
|
||||
// non-virtual so it won't affect the vtable
|
||||
nsresult AddSystemEventListener(const nsAString& aType,
|
||||
nsIDOMEventListener* aListener,
|
||||
bool aUseCapture)
|
||||
{
|
||||
return AddSystemEventListener(aType, aListener, aUseCapture, false, 1);
|
||||
}
|
||||
// non-virtual so it won't affect the vtable
|
||||
nsresult AddSystemEventListener(const nsAString& aType,
|
||||
nsIDOMEventListener* aListener,
|
||||
bool aUseCapture,
|
||||
bool aWantsUntrusted)
|
||||
{
|
||||
return AddSystemEventListener(aType, aListener, aUseCapture,
|
||||
aWantsUntrusted, 2);
|
||||
}
|
||||
%}
|
||||
|
||||
/**
|
||||
* This method allows the removal of event listeners from the event
|
||||
* target. If an EventListener is removed from an EventTarget while it
|
||||
* is processing an event, it will not be triggered by the current actions.
|
||||
* EventListeners can never be invoked after being removed.
|
||||
* Calling removeEventListener with arguments which do not identify any
|
||||
* currently registered EventListener on the EventTarget has no effect.
|
||||
*
|
||||
* @param type Specifies the event type of the EventListener being
|
||||
* removed.
|
||||
* @param listener The EventListener parameter indicates the
|
||||
* EventListener to be removed.
|
||||
* @param useCapture Specifies whether the EventListener being
|
||||
* removed was registered as a capturing listener or
|
||||
* not. If a listener was registered twice, one with
|
||||
* capture and one without, each must be removed
|
||||
* separately. Removal of a capturing listener does
|
||||
* not affect a non-capturing version of the same
|
||||
* listener, and vice versa.
|
||||
*/
|
||||
void removeEventListener(in DOMString type,
|
||||
in nsIDOMEventListener listener,
|
||||
[optional] in boolean useCapture);
|
||||
|
||||
/**
|
||||
* removeSystemEventListener() should be used if you have used
|
||||
* addSystemEventListener().
|
||||
*/
|
||||
[noscript] void removeSystemEventListener(
|
||||
in DOMString type,
|
||||
in nsIDOMEventListener listener,
|
||||
[optional] in boolean aUseCapture);
|
||||
|
||||
/**
|
||||
* This method allows the dispatch of events into the implementations
|
||||
* event model. Events dispatched in this manner will have the same
|
||||
* capturing and bubbling behavior as events dispatched directly by the
|
||||
* implementation. The target of the event is the EventTarget on which
|
||||
* dispatchEvent is called.
|
||||
*
|
||||
* @param evt Specifies the event type, behavior, and contextual
|
||||
* information to be used in processing the event.
|
||||
* @return Indicates whether any of the listeners which handled the
|
||||
* event called preventDefault. If preventDefault was called
|
||||
* the value is false, else the value is true.
|
||||
* @throws INVALID_STATE_ERR: Raised if the Event's type was
|
||||
* not specified by initializing the event before
|
||||
* dispatchEvent was called. Specification of the Event's
|
||||
* type as null or an empty string will also trigger this
|
||||
* exception.
|
||||
*/
|
||||
boolean dispatchEvent(in nsIDOMEvent evt)
|
||||
raises(DOMException);
|
||||
|
||||
/**
|
||||
* Returns the nsIDOMEventTarget object which should be used as the target
|
||||
* of DOMEvents.
|
||||
* Usually |this| is returned, but for example global object returns
|
||||
* the outer object.
|
||||
*/
|
||||
[notxpcom, nostdcall] EventTargetPtr GetTargetForDOMEvent();
|
||||
|
||||
/**
|
||||
* Returns the nsIDOMEventTarget object which should be used as the target
|
||||
* of the event and when constructing event target chain.
|
||||
* Usually |this| is returned, but for example global object returns
|
||||
* the inner object.
|
||||
*/
|
||||
[notxpcom, nostdcall] EventTargetPtr GetTargetForEventTargetChain();
|
||||
|
||||
/**
|
||||
* Called before the capture phase of the event flow.
|
||||
* This is used to create the event target chain and implementations
|
||||
* should set the necessary members of EventChainPreVisitor.
|
||||
* At least aVisitor.mCanHandle must be set,
|
||||
* usually also aVisitor.mParentTarget if mCanHandle is PR_TRUE.
|
||||
* First one tells that this object can handle the aVisitor.mEvent event and
|
||||
* the latter one is the possible parent object for the event target chain.
|
||||
* @see EventDispatcher.h for more documentation about aVisitor.
|
||||
*
|
||||
* @param aVisitor the visitor object which is used to create the
|
||||
* event target chain for event dispatching.
|
||||
*
|
||||
* @note Only EventDispatcher should call this method.
|
||||
*/
|
||||
[noscript, nostdcall]
|
||||
void PreHandleEvent(in EventChainPreVisitorRef aVisitor);
|
||||
|
||||
/**
|
||||
* If EventChainPreVisitor.mWantsWillHandleEvent is set PR_TRUE,
|
||||
* called just before possible event handlers on this object will be called.
|
||||
*/
|
||||
[noscript, nostdcall]
|
||||
void WillHandleEvent(in EventChainPostVisitorRef aVisitor);
|
||||
|
||||
/**
|
||||
* Called after the bubble phase of the system event group.
|
||||
* The default handling of the event should happen here.
|
||||
* @param aVisitor the visitor object which is used during post handling.
|
||||
*
|
||||
* @see EventDispatcher.h for documentation about aVisitor.
|
||||
* @note Only EventDispatcher should call this method.
|
||||
*/
|
||||
[noscript, nostdcall]
|
||||
void PostHandleEvent(in EventChainPostVisitorRef aVisitor);
|
||||
|
||||
/**
|
||||
* Dispatch an event.
|
||||
* @param aEvent the event that is being dispatched.
|
||||
* @param aDOMEvent the event that is being dispatched, use if you want to
|
||||
* dispatch nsIDOMEvent, not only WidgetEvent.
|
||||
* @param aPresContext the current presentation context, can be nullptr.
|
||||
* @param aEventStatus the status returned from the function, can be nullptr.
|
||||
*
|
||||
* @note If both aEvent and aDOMEvent are used, aEvent must be the internal
|
||||
* event of the aDOMEvent.
|
||||
*
|
||||
* If aDOMEvent is not nullptr (in which case aEvent can be nullptr) it is used
|
||||
* for dispatching, otherwise aEvent is used.
|
||||
*
|
||||
* @deprecated This method is here just until all the callers outside Gecko
|
||||
* have been converted to use nsIDOMEventTarget::dispatchEvent.
|
||||
*/
|
||||
[noscript, nostdcall]
|
||||
void DispatchDOMEvent(in WidgetEventPtr aEvent,
|
||||
in nsIDOMEvent aDOMEvent,
|
||||
in nsPresContextPtr aPresContext,
|
||||
in nsEventStatusPtr aEventStatus);
|
||||
|
||||
/**
|
||||
* Get the script context in which the event handlers should be run.
|
||||
* May return null.
|
||||
* @note Caller *must* check the value of aRv.
|
||||
*/
|
||||
[notxpcom, nostdcall]
|
||||
nsIScriptContext GetContextForEventHandlers(out nsresult aRv);
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
||||
#define NS_IMPL_DOMTARGET_DEFAULTS(_class) \
|
||||
mozilla::dom::EventTarget* _class::GetTargetForDOMEvent() { return this; } \
|
||||
mozilla::dom::EventTarget* _class::GetTargetForEventTargetChain() { return this; } \
|
||||
nsresult _class::WillHandleEvent(mozilla::EventChainPostVisitor& aVisitor) { return NS_OK; }
|
||||
|
||||
#define NS_IMPL_REMOVE_SYSTEM_EVENT_LISTENER(aClass) \
|
||||
NS_IMETHODIMP \
|
||||
aClass::RemoveSystemEventListener(const nsAString& aType, \
|
||||
nsIDOMEventListener *aListener, \
|
||||
bool aUseCapture) \
|
||||
{ \
|
||||
mozilla::EventListenerManager* listenerManager = \
|
||||
GetExistingListenerManager(); \
|
||||
if (!listenerManager) { \
|
||||
return NS_OK; \
|
||||
} \
|
||||
mozilla::EventListenerFlags flags; \
|
||||
flags.mInSystemGroup = true; \
|
||||
flags.mCapture = aUseCapture; \
|
||||
listenerManager->RemoveEventListenerByType(aListener, aType, flags); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
%}
|
||||
12
dom/interfaces/events/nsIDOMFocusEvent.idl
Normal file
12
dom/interfaces/events/nsIDOMFocusEvent.idl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* -*- 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 "nsIDOMUIEvent.idl"
|
||||
|
||||
[builtinclass, uuid(ceab9fcd-2cae-42cb-b692-effa7ec48848)]
|
||||
interface nsIDOMFocusEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute nsIDOMEventTarget relatedTarget;
|
||||
};
|
||||
258
dom/interfaces/events/nsIDOMKeyEvent.idl
Normal file
258
dom/interfaces/events/nsIDOMKeyEvent.idl
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
/* -*- 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 "nsIDOMUIEvent.idl"
|
||||
|
||||
[builtinclass, uuid(2e52eb99-670d-469a-b51f-8efee2dd091d)]
|
||||
interface nsIDOMKeyEvent : nsIDOMUIEvent
|
||||
{
|
||||
const unsigned long DOM_VK_CANCEL = 0x03;
|
||||
const unsigned long DOM_VK_HELP = 0x06;
|
||||
const unsigned long DOM_VK_BACK_SPACE = 0x08;
|
||||
const unsigned long DOM_VK_TAB = 0x09;
|
||||
const unsigned long DOM_VK_CLEAR = 0x0C;
|
||||
const unsigned long DOM_VK_RETURN = 0x0D;
|
||||
// DOM_VK_ENTER has been never used for representing native key events.
|
||||
// Therefore, it's removed for preventing developers being confused.
|
||||
// const unsigned long DOM_VK_ENTER = 0x0E;
|
||||
const unsigned long DOM_VK_SHIFT = 0x10;
|
||||
const unsigned long DOM_VK_CONTROL = 0x11;
|
||||
const unsigned long DOM_VK_ALT = 0x12;
|
||||
const unsigned long DOM_VK_PAUSE = 0x13;
|
||||
const unsigned long DOM_VK_CAPS_LOCK = 0x14;
|
||||
const unsigned long DOM_VK_KANA = 0x15;
|
||||
const unsigned long DOM_VK_HANGUL = 0x15;
|
||||
const unsigned long DOM_VK_EISU = 0x16; // Japanese Mac keyboard only
|
||||
const unsigned long DOM_VK_JUNJA = 0x17;
|
||||
const unsigned long DOM_VK_FINAL = 0x18;
|
||||
const unsigned long DOM_VK_HANJA = 0x19;
|
||||
const unsigned long DOM_VK_KANJI = 0x19;
|
||||
const unsigned long DOM_VK_ESCAPE = 0x1B;
|
||||
const unsigned long DOM_VK_CONVERT = 0x1C;
|
||||
const unsigned long DOM_VK_NONCONVERT = 0x1D;
|
||||
const unsigned long DOM_VK_ACCEPT = 0x1E;
|
||||
const unsigned long DOM_VK_MODECHANGE = 0x1F;
|
||||
const unsigned long DOM_VK_SPACE = 0x20;
|
||||
const unsigned long DOM_VK_PAGE_UP = 0x21;
|
||||
const unsigned long DOM_VK_PAGE_DOWN = 0x22;
|
||||
const unsigned long DOM_VK_END = 0x23;
|
||||
const unsigned long DOM_VK_HOME = 0x24;
|
||||
const unsigned long DOM_VK_LEFT = 0x25;
|
||||
const unsigned long DOM_VK_UP = 0x26;
|
||||
const unsigned long DOM_VK_RIGHT = 0x27;
|
||||
const unsigned long DOM_VK_DOWN = 0x28;
|
||||
const unsigned long DOM_VK_SELECT = 0x29;
|
||||
const unsigned long DOM_VK_PRINT = 0x2A;
|
||||
const unsigned long DOM_VK_EXECUTE = 0x2B;
|
||||
const unsigned long DOM_VK_PRINTSCREEN = 0x2C;
|
||||
const unsigned long DOM_VK_INSERT = 0x2D;
|
||||
const unsigned long DOM_VK_DELETE = 0x2E;
|
||||
|
||||
// DOM_VK_0 - DOM_VK_9 match their ascii values
|
||||
const unsigned long DOM_VK_0 = 0x30;
|
||||
const unsigned long DOM_VK_1 = 0x31;
|
||||
const unsigned long DOM_VK_2 = 0x32;
|
||||
const unsigned long DOM_VK_3 = 0x33;
|
||||
const unsigned long DOM_VK_4 = 0x34;
|
||||
const unsigned long DOM_VK_5 = 0x35;
|
||||
const unsigned long DOM_VK_6 = 0x36;
|
||||
const unsigned long DOM_VK_7 = 0x37;
|
||||
const unsigned long DOM_VK_8 = 0x38;
|
||||
const unsigned long DOM_VK_9 = 0x39;
|
||||
|
||||
const unsigned long DOM_VK_COLON = 0x3A;
|
||||
const unsigned long DOM_VK_SEMICOLON = 0x3B;
|
||||
const unsigned long DOM_VK_LESS_THAN = 0x3C;
|
||||
const unsigned long DOM_VK_EQUALS = 0x3D;
|
||||
const unsigned long DOM_VK_GREATER_THAN = 0x3E;
|
||||
const unsigned long DOM_VK_QUESTION_MARK = 0x3F;
|
||||
const unsigned long DOM_VK_AT = 0x40;
|
||||
|
||||
// DOM_VK_A - DOM_VK_Z match their ascii values
|
||||
const unsigned long DOM_VK_A = 0x41;
|
||||
const unsigned long DOM_VK_B = 0x42;
|
||||
const unsigned long DOM_VK_C = 0x43;
|
||||
const unsigned long DOM_VK_D = 0x44;
|
||||
const unsigned long DOM_VK_E = 0x45;
|
||||
const unsigned long DOM_VK_F = 0x46;
|
||||
const unsigned long DOM_VK_G = 0x47;
|
||||
const unsigned long DOM_VK_H = 0x48;
|
||||
const unsigned long DOM_VK_I = 0x49;
|
||||
const unsigned long DOM_VK_J = 0x4A;
|
||||
const unsigned long DOM_VK_K = 0x4B;
|
||||
const unsigned long DOM_VK_L = 0x4C;
|
||||
const unsigned long DOM_VK_M = 0x4D;
|
||||
const unsigned long DOM_VK_N = 0x4E;
|
||||
const unsigned long DOM_VK_O = 0x4F;
|
||||
const unsigned long DOM_VK_P = 0x50;
|
||||
const unsigned long DOM_VK_Q = 0x51;
|
||||
const unsigned long DOM_VK_R = 0x52;
|
||||
const unsigned long DOM_VK_S = 0x53;
|
||||
const unsigned long DOM_VK_T = 0x54;
|
||||
const unsigned long DOM_VK_U = 0x55;
|
||||
const unsigned long DOM_VK_V = 0x56;
|
||||
const unsigned long DOM_VK_W = 0x57;
|
||||
const unsigned long DOM_VK_X = 0x58;
|
||||
const unsigned long DOM_VK_Y = 0x59;
|
||||
const unsigned long DOM_VK_Z = 0x5A;
|
||||
|
||||
const unsigned long DOM_VK_WIN = 0x5B;
|
||||
const unsigned long DOM_VK_CONTEXT_MENU = 0x5D;
|
||||
const unsigned long DOM_VK_SLEEP = 0x5F;
|
||||
|
||||
// Numpad keys
|
||||
const unsigned long DOM_VK_NUMPAD0 = 0x60;
|
||||
const unsigned long DOM_VK_NUMPAD1 = 0x61;
|
||||
const unsigned long DOM_VK_NUMPAD2 = 0x62;
|
||||
const unsigned long DOM_VK_NUMPAD3 = 0x63;
|
||||
const unsigned long DOM_VK_NUMPAD4 = 0x64;
|
||||
const unsigned long DOM_VK_NUMPAD5 = 0x65;
|
||||
const unsigned long DOM_VK_NUMPAD6 = 0x66;
|
||||
const unsigned long DOM_VK_NUMPAD7 = 0x67;
|
||||
const unsigned long DOM_VK_NUMPAD8 = 0x68;
|
||||
const unsigned long DOM_VK_NUMPAD9 = 0x69;
|
||||
const unsigned long DOM_VK_MULTIPLY = 0x6A;
|
||||
const unsigned long DOM_VK_ADD = 0x6B;
|
||||
const unsigned long DOM_VK_SEPARATOR = 0x6C;
|
||||
const unsigned long DOM_VK_SUBTRACT = 0x6D;
|
||||
const unsigned long DOM_VK_DECIMAL = 0x6E;
|
||||
const unsigned long DOM_VK_DIVIDE = 0x6F;
|
||||
|
||||
const unsigned long DOM_VK_F1 = 0x70;
|
||||
const unsigned long DOM_VK_F2 = 0x71;
|
||||
const unsigned long DOM_VK_F3 = 0x72;
|
||||
const unsigned long DOM_VK_F4 = 0x73;
|
||||
const unsigned long DOM_VK_F5 = 0x74;
|
||||
const unsigned long DOM_VK_F6 = 0x75;
|
||||
const unsigned long DOM_VK_F7 = 0x76;
|
||||
const unsigned long DOM_VK_F8 = 0x77;
|
||||
const unsigned long DOM_VK_F9 = 0x78;
|
||||
const unsigned long DOM_VK_F10 = 0x79;
|
||||
const unsigned long DOM_VK_F11 = 0x7A;
|
||||
const unsigned long DOM_VK_F12 = 0x7B;
|
||||
const unsigned long DOM_VK_F13 = 0x7C;
|
||||
const unsigned long DOM_VK_F14 = 0x7D;
|
||||
const unsigned long DOM_VK_F15 = 0x7E;
|
||||
const unsigned long DOM_VK_F16 = 0x7F;
|
||||
const unsigned long DOM_VK_F17 = 0x80;
|
||||
const unsigned long DOM_VK_F18 = 0x81;
|
||||
const unsigned long DOM_VK_F19 = 0x82;
|
||||
const unsigned long DOM_VK_F20 = 0x83;
|
||||
const unsigned long DOM_VK_F21 = 0x84;
|
||||
const unsigned long DOM_VK_F22 = 0x85;
|
||||
const unsigned long DOM_VK_F23 = 0x86;
|
||||
const unsigned long DOM_VK_F24 = 0x87;
|
||||
|
||||
const unsigned long DOM_VK_NUM_LOCK = 0x90;
|
||||
const unsigned long DOM_VK_SCROLL_LOCK = 0x91;
|
||||
|
||||
// OEM specific virtual keyCode of Windows should pass through DOM keyCode
|
||||
// for compatibility with the other web browsers on Windows.
|
||||
const unsigned long DOM_VK_WIN_OEM_FJ_JISHO = 0x92;
|
||||
const unsigned long DOM_VK_WIN_OEM_FJ_MASSHOU = 0x93;
|
||||
const unsigned long DOM_VK_WIN_OEM_FJ_TOUROKU = 0x94;
|
||||
const unsigned long DOM_VK_WIN_OEM_FJ_LOYA = 0x95;
|
||||
const unsigned long DOM_VK_WIN_OEM_FJ_ROYA = 0x96;
|
||||
|
||||
const unsigned long DOM_VK_CIRCUMFLEX = 0xA0;
|
||||
const unsigned long DOM_VK_EXCLAMATION = 0xA1;
|
||||
const unsigned long DOM_VK_DOUBLE_QUOTE = 0xA2;
|
||||
const unsigned long DOM_VK_HASH = 0xA3;
|
||||
const unsigned long DOM_VK_DOLLAR = 0xA4;
|
||||
const unsigned long DOM_VK_PERCENT = 0xA5;
|
||||
const unsigned long DOM_VK_AMPERSAND = 0xA6;
|
||||
const unsigned long DOM_VK_UNDERSCORE = 0xA7;
|
||||
const unsigned long DOM_VK_OPEN_PAREN = 0xA8;
|
||||
const unsigned long DOM_VK_CLOSE_PAREN = 0xA9;
|
||||
const unsigned long DOM_VK_ASTERISK = 0xAA;
|
||||
const unsigned long DOM_VK_PLUS = 0xAB;
|
||||
const unsigned long DOM_VK_PIPE = 0xAC;
|
||||
const unsigned long DOM_VK_HYPHEN_MINUS = 0xAD;
|
||||
|
||||
const unsigned long DOM_VK_OPEN_CURLY_BRACKET = 0xAE;
|
||||
const unsigned long DOM_VK_CLOSE_CURLY_BRACKET = 0xAF;
|
||||
|
||||
const unsigned long DOM_VK_TILDE = 0xB0;
|
||||
|
||||
const unsigned long DOM_VK_VOLUME_MUTE = 0xB5;
|
||||
const unsigned long DOM_VK_VOLUME_DOWN = 0xB6;
|
||||
const unsigned long DOM_VK_VOLUME_UP = 0xB7;
|
||||
|
||||
const unsigned long DOM_VK_COMMA = 0xBC;
|
||||
const unsigned long DOM_VK_PERIOD = 0xBE;
|
||||
const unsigned long DOM_VK_SLASH = 0xBF;
|
||||
const unsigned long DOM_VK_BACK_QUOTE = 0xC0;
|
||||
const unsigned long DOM_VK_OPEN_BRACKET = 0xDB; // square bracket
|
||||
const unsigned long DOM_VK_BACK_SLASH = 0xDC;
|
||||
const unsigned long DOM_VK_CLOSE_BRACKET = 0xDD; // square bracket
|
||||
const unsigned long DOM_VK_QUOTE = 0xDE; // Apostrophe
|
||||
|
||||
const unsigned long DOM_VK_META = 0xE0;
|
||||
const unsigned long DOM_VK_ALTGR = 0xE1;
|
||||
|
||||
// OEM specific virtual keyCode of Windows should pass through DOM keyCode
|
||||
// for compatibility with the other web browsers on Windows.
|
||||
const unsigned long DOM_VK_WIN_ICO_HELP = 0xE3;
|
||||
const unsigned long DOM_VK_WIN_ICO_00 = 0xE4;
|
||||
const unsigned long DOM_VK_WIN_ICO_CLEAR = 0xE6;
|
||||
const unsigned long DOM_VK_WIN_OEM_RESET = 0xE9;
|
||||
const unsigned long DOM_VK_WIN_OEM_JUMP = 0xEA;
|
||||
const unsigned long DOM_VK_WIN_OEM_PA1 = 0xEB;
|
||||
const unsigned long DOM_VK_WIN_OEM_PA2 = 0xEC;
|
||||
const unsigned long DOM_VK_WIN_OEM_PA3 = 0xED;
|
||||
const unsigned long DOM_VK_WIN_OEM_WSCTRL = 0xEE;
|
||||
const unsigned long DOM_VK_WIN_OEM_CUSEL = 0xEF;
|
||||
const unsigned long DOM_VK_WIN_OEM_ATTN = 0xF0;
|
||||
const unsigned long DOM_VK_WIN_OEM_FINISH = 0xF1;
|
||||
const unsigned long DOM_VK_WIN_OEM_COPY = 0xF2;
|
||||
const unsigned long DOM_VK_WIN_OEM_AUTO = 0xF3;
|
||||
const unsigned long DOM_VK_WIN_OEM_ENLW = 0xF4;
|
||||
const unsigned long DOM_VK_WIN_OEM_BACKTAB = 0xF5;
|
||||
|
||||
// Following keys are not used on most keyboards. However, for compatibility
|
||||
// with other browsers on Windows, we should define them.
|
||||
const unsigned long DOM_VK_ATTN = 0xF6;
|
||||
const unsigned long DOM_VK_CRSEL = 0xF7;
|
||||
const unsigned long DOM_VK_EXSEL = 0xF8;
|
||||
const unsigned long DOM_VK_EREOF = 0xF9;
|
||||
const unsigned long DOM_VK_PLAY = 0xFA;
|
||||
const unsigned long DOM_VK_ZOOM = 0xFB;
|
||||
const unsigned long DOM_VK_PA1 = 0xFD;
|
||||
|
||||
// OEM specific virtual keyCode of Windows should pass through DOM keyCode
|
||||
// for compatibility with the other web browsers on Windows.
|
||||
const unsigned long DOM_VK_WIN_OEM_CLEAR = 0xFE;
|
||||
|
||||
readonly attribute unsigned long charCode;
|
||||
readonly attribute unsigned long keyCode;
|
||||
|
||||
readonly attribute boolean altKey;
|
||||
readonly attribute boolean ctrlKey;
|
||||
readonly attribute boolean shiftKey;
|
||||
readonly attribute boolean metaKey;
|
||||
|
||||
void initKeyEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in mozIDOMWindow viewArg,
|
||||
in boolean ctrlKeyArg,
|
||||
in boolean altKeyArg,
|
||||
in boolean shiftKeyArg,
|
||||
in boolean metaKeyArg,
|
||||
in unsigned long keyCodeArg,
|
||||
in unsigned long charCodeArg);
|
||||
|
||||
bool getModifierState(in DOMString keyArg);
|
||||
|
||||
const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
|
||||
const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
|
||||
const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
|
||||
const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
|
||||
|
||||
readonly attribute unsigned long location;
|
||||
readonly attribute boolean repeat;
|
||||
|
||||
readonly attribute DOMString key;
|
||||
};
|
||||
69
dom/interfaces/events/nsIDOMMouseEvent.idl
Normal file
69
dom/interfaces/events/nsIDOMMouseEvent.idl
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/* -*- 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 "nsIDOMUIEvent.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMMouseEvent interface is the datatype for all mouse events
|
||||
* in the Document Object Model.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[builtinclass, uuid(5bdab8d8-7933-4c5c-b6d1-ab34481237f7)]
|
||||
interface nsIDOMMouseEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute long screenX;
|
||||
readonly attribute long screenY;
|
||||
|
||||
readonly attribute long mozMovementX;
|
||||
readonly attribute long mozMovementY;
|
||||
|
||||
readonly attribute long clientX;
|
||||
readonly attribute long clientY;
|
||||
|
||||
readonly attribute boolean ctrlKey;
|
||||
readonly attribute boolean shiftKey;
|
||||
readonly attribute boolean altKey;
|
||||
readonly attribute boolean metaKey;
|
||||
|
||||
readonly attribute short button;
|
||||
readonly attribute unsigned short buttons;
|
||||
readonly attribute nsIDOMEventTarget relatedTarget;
|
||||
|
||||
void initMouseEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in mozIDOMWindow viewArg,
|
||||
in long detailArg,
|
||||
in long screenXArg,
|
||||
in long screenYArg,
|
||||
in long clientXArg,
|
||||
in long clientYArg,
|
||||
in boolean ctrlKeyArg,
|
||||
in boolean altKeyArg,
|
||||
in boolean shiftKeyArg,
|
||||
in boolean metaKeyArg,
|
||||
in unsigned short buttonArg,
|
||||
in nsIDOMEventTarget relatedTargetArg);
|
||||
|
||||
|
||||
// Finger or touch pressure event value
|
||||
// ranges between 0.0 and 1.0
|
||||
readonly attribute float mozPressure;
|
||||
|
||||
const unsigned short MOZ_SOURCE_UNKNOWN = 0;
|
||||
const unsigned short MOZ_SOURCE_MOUSE = 1;
|
||||
const unsigned short MOZ_SOURCE_PEN = 2;
|
||||
const unsigned short MOZ_SOURCE_ERASER = 3;
|
||||
const unsigned short MOZ_SOURCE_CURSOR = 4;
|
||||
const unsigned short MOZ_SOURCE_TOUCH = 5;
|
||||
const unsigned short MOZ_SOURCE_KEYBOARD = 6;
|
||||
|
||||
readonly attribute unsigned short mozInputSource;
|
||||
|
||||
bool getModifierState(in DOMString keyArg);
|
||||
};
|
||||
13
dom/interfaces/events/nsIDOMMouseScrollEvent.idl
Normal file
13
dom/interfaces/events/nsIDOMMouseScrollEvent.idl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/* -*- 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 "nsIDOMMouseEvent.idl"
|
||||
|
||||
[builtinclass, uuid(327bdd54-f772-4015-b856-9692154a066c)]
|
||||
interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
|
||||
{
|
||||
const long HORIZONTAL_AXIS = 1;
|
||||
const long VERTICAL_AXIS = 2;
|
||||
};
|
||||
29
dom/interfaces/events/nsIDOMMutationEvent.idl
Normal file
29
dom/interfaces/events/nsIDOMMutationEvent.idl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- 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"
|
||||
#include "nsIDOMNode.idl"
|
||||
|
||||
[builtinclass, uuid(30c9997f-bc4c-4890-b890-febb6ae3051b)]
|
||||
interface nsIDOMMutationEvent : nsISupports
|
||||
{
|
||||
const unsigned short MODIFICATION = 1;
|
||||
const unsigned short ADDITION = 2;
|
||||
const unsigned short REMOVAL = 3;
|
||||
|
||||
readonly attribute nsIDOMNode relatedNode;
|
||||
readonly attribute DOMString prevValue;
|
||||
readonly attribute DOMString newValue;
|
||||
readonly attribute DOMString attrName;
|
||||
readonly attribute unsigned short attrChange;
|
||||
void initMutationEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMNode relatedNodeArg,
|
||||
in DOMString prevValueArg,
|
||||
in DOMString newValueArg,
|
||||
in DOMString attrNameArg,
|
||||
in unsigned short attrChangeArg);
|
||||
};
|
||||
21
dom/interfaces/events/nsIDOMNSEvent.idl
Normal file
21
dom/interfaces/events/nsIDOMNSEvent.idl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* -*- 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"
|
||||
|
||||
%{C++
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
%}
|
||||
|
||||
[uuid(2580b4a2-6d85-4ca6-9be2-98f3406ad296)]
|
||||
interface nsIDOMNSEvent : nsISupports
|
||||
{
|
||||
const long ALT_MASK = 0x00000001;
|
||||
const long CONTROL_MASK = 0x00000002;
|
||||
const long SHIFT_MASK = 0x00000004;
|
||||
const long META_MASK = 0x00000008;
|
||||
};
|
||||
41
dom/interfaces/events/nsIDOMNotifyPaintEvent.idl
Normal file
41
dom/interfaces/events/nsIDOMNotifyPaintEvent.idl
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/* -*- 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"
|
||||
#include "nsIDOMClientRectList.idl"
|
||||
#include "nsIDOMClientRect.idl"
|
||||
|
||||
interface nsIDOMPaintRequestList;
|
||||
|
||||
/**
|
||||
* The nsIDOMNotifyPaintEvent interface is used for the MozDOMAfterPaint
|
||||
* event, which fires at a window when painting has happened in
|
||||
* that window.
|
||||
*/
|
||||
[builtinclass, uuid(63f573a0-3e4e-474b-a0c2-bb4ca93febaa)]
|
||||
interface nsIDOMNotifyPaintEvent : nsISupports
|
||||
{
|
||||
/**
|
||||
* Get a list of rectangles which are affected. The rectangles are in CSS pixels
|
||||
* relative to the viewport origin.
|
||||
* If the caller is not trusted (e.g., regular Web content) then only painting
|
||||
* caused by the current document is reported; in particular, painting in subdocuments
|
||||
* is not reported.
|
||||
*/
|
||||
readonly attribute nsIDOMClientRectList clientRects;
|
||||
/**
|
||||
* Get the bounding box of the rectangles which are affected. The rectangle
|
||||
* is in CSS pixels relative to the viewport origin.
|
||||
* If the caller is not trusted (e.g., regular Web content) then only painting
|
||||
* caused by the current document is reported; in particular, painting in subdocuments
|
||||
* is not reported.
|
||||
*/
|
||||
readonly attribute nsIDOMClientRect boundingClientRect;
|
||||
|
||||
readonly attribute nsISupports /* PaintRequestList */ paintRequests;
|
||||
|
||||
readonly attribute unsigned long long transactionId;
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue