mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 655517 - Remove nsIDOMDocumentEvent; f=ehsan r=smaug
This commit is contained in:
parent
ef87572c02
commit
fb6f5dd0ca
@ -35,6 +35,9 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#define CreateEvent CreateEventA
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
#include "States.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsApplicationAccessibleWrap.h"
|
||||
@ -48,7 +51,6 @@
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
@ -76,11 +78,8 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsRootAccessible.h"
|
||||
#include "nsIDOMNSEventTarget.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsXULTreeAccessible.h"
|
||||
@ -415,10 +414,10 @@ nsRootAccessible::FireCurrentFocusEvent()
|
||||
return; // No current focus
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(mDocument);
|
||||
if (docEvent) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
|
||||
if (domDoc) {
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
if (NS_SUCCEEDED(docEvent->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
if (NS_SUCCEEDED(domDoc->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event))) &&
|
||||
NS_SUCCEEDED(event->InitEvent(NS_LITERAL_STRING("focus"), PR_TRUE, PR_TRUE))) {
|
||||
|
||||
|
@ -928,7 +928,7 @@ public:
|
||||
/**
|
||||
* This method creates and dispatches a trusted event.
|
||||
* Works only with events which can be created by calling
|
||||
* nsIDOMDocumentEvent::CreateEvent() with parameter "Events".
|
||||
* nsIDOMDocument::CreateEvent() with parameter "Events".
|
||||
* @param aDoc The document which will be used to create the event.
|
||||
* @param aTarget The target of the event, should be QIable to
|
||||
* nsIDOMEventTarget.
|
||||
@ -949,7 +949,7 @@ public:
|
||||
* This method creates and dispatches a trusted event to the chrome
|
||||
* event handler.
|
||||
* Works only with events which can be created by calling
|
||||
* nsIDOMDocumentEvent::CreateEvent() with parameter "Events".
|
||||
* nsIDOMDocument::CreateEvent() with parameter "Events".
|
||||
* @param aDocument The document which will be used to create the event,
|
||||
* and whose window's chrome handler will be used to
|
||||
* dispatch the event.
|
||||
|
@ -115,7 +115,6 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#ifdef MOZ_XTF
|
||||
#include "nsIXTFService.h"
|
||||
static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
||||
@ -3345,13 +3344,13 @@ nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
nsIDOMEvent** aEvent,
|
||||
nsIDOMEventTarget** aTargetOut)
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(aDoc));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aDoc);
|
||||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(aTarget));
|
||||
NS_ENSURE_TRUE(docEvent && target, NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsresult rv =
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
@ -5530,10 +5529,10 @@ nsContentUtils::DispatchXULCommand(nsIContent* aTarget,
|
||||
{
|
||||
NS_ENSURE_STATE(aTarget);
|
||||
nsIDocument* doc = aTarget->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(doc);
|
||||
NS_ENSURE_STATE(docEvent);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc);
|
||||
NS_ENSURE_STATE(domDoc);
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event);
|
||||
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand);
|
||||
|
@ -4130,13 +4130,12 @@ nsDocument::DispatchContentLoadedEvents()
|
||||
if (target_frame) {
|
||||
nsCOMPtr<nsIDocument> parent = mParentDocument;
|
||||
do {
|
||||
nsCOMPtr<nsIDOMDocumentEvent> document_event =
|
||||
do_QueryInterface(parent);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(parent);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent;
|
||||
if (document_event) {
|
||||
document_event->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
if (domDoc) {
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event));
|
||||
|
||||
privateEvent = do_QueryInterface(event);
|
||||
|
@ -69,7 +69,6 @@
|
||||
#include "nsIParser.h"
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOM3DocumentEvent.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
@ -493,7 +492,6 @@ protected:
|
||||
class nsDocument : public nsIDocument,
|
||||
public nsIDOMXMLDocument, // inherits nsIDOMDocument
|
||||
public nsIDOMNSDocument,
|
||||
public nsIDOMDocumentEvent,
|
||||
public nsIDOM3DocumentEvent,
|
||||
public nsIDOMNSDocumentStyle,
|
||||
public nsIDOMDocumentXBL,
|
||||
@ -798,9 +796,6 @@ public:
|
||||
// nsIDOMNSDocument
|
||||
NS_DECL_NSIDOMNSDOCUMENT
|
||||
|
||||
// nsIDOMDocumentEvent
|
||||
NS_DECL_NSIDOMDOCUMENTEVENT
|
||||
|
||||
// nsIDOM3DocumentEvent
|
||||
NS_DECL_NSIDOM3DOCUMENTEVENT
|
||||
|
||||
@ -1252,7 +1247,6 @@ protected:
|
||||
NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(_class) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNode, nsDocument)
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIExternalProtocolHandler.h"
|
||||
#include "nsEventStates.h"
|
||||
@ -257,15 +257,15 @@ nsPluginCrashedEvent::Run()
|
||||
LOG(("OBJLC []: Firing plugin crashed event for content %p\n",
|
||||
mContent.get()));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> domEventDoc =
|
||||
nsCOMPtr<nsIDOMDocument> domDoc =
|
||||
do_QueryInterface(mContent->GetDocument());
|
||||
if (!domEventDoc) {
|
||||
if (!domDoc) {
|
||||
NS_WARNING("Couldn't get document for PluginCrashed event!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
domEventDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
nsCOMPtr<nsIDOMDataContainerEvent> containerEvent(do_QueryInterface(event));
|
||||
|
@ -39,6 +39,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsWebSocket.h"
|
||||
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -57,7 +58,6 @@
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIUnicodeEncoder.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMMessageEvent.h"
|
||||
#include "nsIPromptFactory.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "nsIVariant.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
|
@ -113,7 +113,6 @@
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMMouseScrollEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
@ -64,7 +64,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMProgressEvent.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsParserUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
@ -68,7 +68,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsMediaError.h"
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
@ -2250,12 +2249,12 @@ nsresult nsHTMLMediaElement::DispatchAudioAvailableEvent(float* aFrameBuffer,
|
||||
// which frees the memory when it's destroyed.
|
||||
nsAutoArrayPtr<float> frameBuffer(aFrameBuffer);
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(GetOwnerDoc()));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(GetOwnerDoc());
|
||||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(static_cast<nsIContent*>(this)));
|
||||
NS_ENSURE_TRUE(docEvent && target, NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsresult rv = docEvent->CreateEvent(NS_LITERAL_STRING("MozAudioAvailableEvent"),
|
||||
nsresult rv = domDoc->CreateEvent(NS_LITERAL_STRING("MozAudioAvailableEvent"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMNotifyAudioAvailableEvent> audioavailableEvent(do_QueryInterface(event));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIBoxObject.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
|
||||
// Notify/query select frame for selectedIndex
|
||||
#include "nsIDocument.h"
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMProgressEvent.h"
|
||||
#include "nsMediaError.h"
|
||||
|
||||
|
@ -64,9 +64,8 @@ nsSVGDocument::~nsSVGDocument()
|
||||
DOMCI_NODE_DATA(SVGDocument, nsSVGDocument)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(nsSVGDocument)
|
||||
NS_INTERFACE_TABLE_INHERITED2(nsSVGDocument,
|
||||
nsIDOMSVGDocument,
|
||||
nsIDOMDocumentEvent)
|
||||
NS_INTERFACE_TABLE_INHERITED1(nsSVGDocument,
|
||||
nsIDOMSVGDocument)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDocument)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsXMLDocument)
|
||||
|
@ -54,7 +54,6 @@ public:
|
||||
NS_DECL_NSIDOMSVGDOCUMENT
|
||||
NS_FORWARD_NSIDOMDOCUMENT(nsXMLDocument::)
|
||||
NS_FORWARD_NSIDOMNODE(nsXMLDocument::)
|
||||
NS_FORWARD_NSIDOMDOCUMENTEVENT(nsXMLDocument::)
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
|
@ -222,7 +222,6 @@
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIDOMDOMImplementation.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsDOMAttribute.h"
|
||||
#include "nsIDOMText.h"
|
||||
#include "nsIDOM3Text.h"
|
||||
@ -2328,7 +2327,6 @@ nsDOMClassInfo::RegisterExternalClasses()
|
||||
|
||||
#define DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocument) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \
|
||||
|
@ -115,7 +115,6 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
@ -5513,9 +5512,8 @@ nsGlobalWindow::FirePopupBlockedEvent(nsIDOMDocument* aDoc,
|
||||
if (aDoc) {
|
||||
// Fire a "DOMPopupBlocked" event so that the UI can hear about
|
||||
// blocked popups.
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(aDoc));
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("PopupBlockedEvents"),
|
||||
aDoc->CreateEvent(NS_LITERAL_STRING("PopupBlockedEvents"),
|
||||
getter_AddRefs(event));
|
||||
if (event) {
|
||||
nsCOMPtr<nsIDOMPopupBlockedEvent> pbev(do_QueryInterface(event));
|
||||
@ -5928,12 +5926,11 @@ PostMessageEvent::Run()
|
||||
|
||||
|
||||
// Create the event
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent =
|
||||
do_QueryInterface(targetWindow->mDocument);
|
||||
if (!docEvent)
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(targetWindow->mDocument);
|
||||
if (!domDoc)
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("MessageEvent"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("MessageEvent"),
|
||||
getter_AddRefs(event));
|
||||
if (!event)
|
||||
return NS_OK;
|
||||
|
@ -24,6 +24,7 @@
|
||||
* Johnny Stenback <jst@netscape.com>
|
||||
* Jonas Sicking <sicking@bigfoot.com>
|
||||
* Ms2ger <ms2ger@gmail.com>
|
||||
* Tom Pixley <joki@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -58,7 +59,7 @@ interface nsIDOMTreeWalker;
|
||||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[scriptable, uuid(e286fcde-873d-4902-874b-49255737ee7d)]
|
||||
[scriptable, uuid(238bdcb3-8645-4b3e-bf67-e82437acded4)]
|
||||
interface nsIDOMDocument : nsIDOMNode
|
||||
{
|
||||
readonly attribute nsIDOMDocumentType doctype;
|
||||
@ -139,4 +140,7 @@ interface nsIDOMDocument : nsIDOMNode
|
||||
in nsIDOMNodeFilter filter,
|
||||
in boolean entityReferenceExpansion)
|
||||
raises(DOMException);
|
||||
|
||||
nsIDOMEvent createEvent(in DOMString eventType)
|
||||
raises(DOMException);
|
||||
};
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "nsIDOMDocument.idl"
|
||||
|
||||
[scriptable, uuid(305a78cc-da33-402c-bcd5-44eb993ab391)]
|
||||
[scriptable, uuid(044dc1e7-3fe7-4052-ad68-e4ee150a3329)]
|
||||
interface nsIDOMXMLDocument : nsIDOMDocument
|
||||
{
|
||||
// DOM Level 3 Load & Save, DocumentLS
|
||||
|
@ -47,7 +47,6 @@ XPIDL_MODULE = dom_events
|
||||
GRE_MODULE = 1
|
||||
|
||||
SDK_XPIDLSRCS = \
|
||||
nsIDOMDocumentEvent.idl \
|
||||
nsIDOMEvent.idl \
|
||||
nsIDOMEventTarget.idl \
|
||||
nsIDOMEventListener.idl \
|
||||
|
@ -1,55 +0,0 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2000
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Tom Pixley <joki@netscape.com> (original author)
|
||||
* Johnny Stenback <jst@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMDocumentEvent interface is the interface to the event
|
||||
* factory method on a DOM document object.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(46b91d66-28e2-11d4-ab1e-0010830123b4)]
|
||||
interface nsIDOMDocumentEvent : nsISupports
|
||||
{
|
||||
nsIDOMEvent createEvent(in DOMString eventType)
|
||||
raises(DOMException);
|
||||
};
|
@ -50,7 +50,7 @@
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(4b21c9f8-68bc-4bce-b452-0f844c532dfc)]
|
||||
[scriptable, uuid(b2c88331-2c2d-432a-8d0c-f0fbfdaf3f5f)]
|
||||
interface nsIDOMHTMLDocument : nsIDOMDocument
|
||||
{
|
||||
attribute DOMString title;
|
||||
|
@ -39,9 +39,8 @@
|
||||
|
||||
interface nsIDOMSVGSVGElement;
|
||||
|
||||
[scriptable, uuid(32f1cd80-9328-4f55-938a-0734217a7944)]
|
||||
[scriptable, uuid(e760915a-61cd-4787-8617-cd417ebb69b4)]
|
||||
interface nsIDOMSVGDocument : nsIDOMDocument
|
||||
/* , nsIDOMDocumentEvent */
|
||||
{
|
||||
readonly attribute DOMString title;
|
||||
readonly attribute DOMString referrer;
|
||||
|
@ -74,8 +74,6 @@ interface nsIDOMSVGSVGElement
|
||||
nsIDOMSVGFitToViewBox,
|
||||
nsIDOMSVGZoomAndPan,
|
||||
events::nsIDOMEventTarget,
|
||||
events::nsIDOMDocumentEvent,
|
||||
css::nsIDOMViewCSS,
|
||||
css::nsIDOMDocumentCSS
|
||||
*/
|
||||
{
|
||||
@ -125,8 +123,3 @@ interface nsIDOMSVGSVGElement
|
||||
nsIDOMSVGTransform createSVGTransformFromMatrix(in nsIDOMSVGMatrix matrix);
|
||||
nsIDOMElement getElementById(in DOMString elementId);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMDeviceOrientationEvent.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIPrefService.h"
|
||||
@ -257,13 +256,12 @@ nsAccelerometer::AccelerationChanged(double alpha, double beta, double gamma)
|
||||
nsCOMPtr<nsIDOMDocument> domdoc;
|
||||
mWindowListeners[i]->GetDocument(getter_AddRefs(domdoc));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docevent(do_QueryInterface(domdoc));
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
|
||||
PRBool defaultActionEnabled = PR_TRUE;
|
||||
|
||||
if (docevent) {
|
||||
docevent->CreateEvent(NS_LITERAL_STRING("DeviceOrientationEvent"), getter_AddRefs(event));
|
||||
if (domdoc) {
|
||||
domdoc->CreateEvent(NS_LITERAL_STRING("DeviceOrientationEvent"), getter_AddRefs(event));
|
||||
|
||||
nsCOMPtr<nsIDOMDeviceOrientationEvent> oe = do_QueryInterface(event);
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsString.h"
|
||||
|
||||
/****************************************************************
|
||||
@ -89,13 +88,12 @@ nsAutoWindowStateHelper::DispatchCustomEvent(const char *aEventName)
|
||||
nsCOMPtr<nsIDOMDocument> domdoc;
|
||||
mWindow->GetDocument(getter_AddRefs(domdoc));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docevent(do_QueryInterface(domdoc));
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
|
||||
PRBool defaultActionEnabled = PR_TRUE;
|
||||
|
||||
if (docevent) {
|
||||
docevent->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
if (domdoc) {
|
||||
domdoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
if (privateEvent) {
|
||||
|
@ -111,6 +111,7 @@ members = [
|
||||
'nsIDOMDocument.adoptNode',
|
||||
'nsIDOMDocument.defaultView',
|
||||
'nsIDOMDocument.createNodeIterator',
|
||||
'nsIDOMDocument.createEvent',
|
||||
'nsIDOMElement.removeAttributeNS',
|
||||
'nsIDOMElement.removeAttribute',
|
||||
'nsIDOMElement.getAttribute',
|
||||
@ -182,7 +183,6 @@ members = [
|
||||
'nsIDOMEventTarget.dispatchEvent',
|
||||
'nsIDOMEventTarget.removeEventListener',
|
||||
'nsIDOMNSEventTarget.addEventListener',
|
||||
'nsIDOMDocumentEvent.*',
|
||||
|
||||
'nsIDOMEvent.*',
|
||||
'nsIDOMMouseEvent.*',
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "nsIDocumentViewer.h"
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
#include "nsIDocumentViewerPrint.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMBeforeUnloadEvent.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -1142,9 +1141,9 @@ DocumentViewerImpl::PermitUnload(PRBool aCallerClosesWindow, PRBool *aPermitUnlo
|
||||
|
||||
// Now, fire an BeforeUnload event to the document and see if it's ok
|
||||
// to unload...
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(mDocument);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("beforeunloadevent"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("beforeunloadevent"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMBeforeUnloadEvent> beforeUnload = do_QueryInterface(event);
|
||||
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(beforeUnload);
|
||||
|
@ -103,7 +103,6 @@ enum { XKeyPress = KeyPress };
|
||||
#include "nsIDOMHTMLEmbedElement.h"
|
||||
#include "nsIDOMHTMLAppletElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMMouseListener.h"
|
||||
#include "nsIDOMMouseMotionListener.h"
|
||||
#include "nsIDOMFocusListener.h"
|
||||
|
@ -70,7 +70,6 @@
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIContent.h"
|
||||
@ -4459,13 +4458,12 @@ nsTreeBodyFrame::FireRowCountChangedEvent(PRInt32 aIndex, PRInt32 aCount)
|
||||
if (!content)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> domEventDoc =
|
||||
do_QueryInterface(content->GetOwnerDoc());
|
||||
if (!domEventDoc)
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(content->GetOwnerDoc());
|
||||
if (!domDoc)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
domEventDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
getter_AddRefs(event));
|
||||
|
||||
nsCOMPtr<nsIDOMDataContainerEvent> treeEvent(do_QueryInterface(event));
|
||||
@ -4515,13 +4513,12 @@ nsTreeBodyFrame::FireInvalidateEvent(PRInt32 aStartRowIdx, PRInt32 aEndRowIdx,
|
||||
if (!content)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> domEventDoc =
|
||||
do_QueryInterface(content->GetOwnerDoc());
|
||||
if (!domEventDoc)
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(content->GetOwnerDoc());
|
||||
if (!domDoc)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
domEventDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
getter_AddRefs(event));
|
||||
|
||||
nsCOMPtr<nsIDOMDataContainerEvent> treeEvent(do_QueryInterface(event));
|
||||
|
@ -74,7 +74,6 @@
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMWindowCollection.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
@ -550,13 +549,8 @@ nsNSSComponent::DispatchEventToWindow(nsIDOMWindow *domWin,
|
||||
}
|
||||
|
||||
// create the event
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(doc, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
rv = docEvent->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
rv = doc->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
@ -63,7 +63,6 @@
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsILoginManager.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
@ -528,12 +527,10 @@ nsFormFillController::OnTextEntered(PRBool* aPrevent)
|
||||
// Fire off a DOMAutoComplete event
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
mFocusedInput->GetOwnerDocument(getter_AddRefs(domDoc));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> doc = do_QueryInterface(domDoc);
|
||||
NS_ENSURE_STATE(doc);
|
||||
NS_ENSURE_STATE(domDoc);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
doc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
NS_ENSURE_STATE(privateEvent);
|
||||
|
||||
|
@ -54,7 +54,6 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
nsMenuItemX::nsMenuItemX()
|
||||
@ -211,15 +210,15 @@ nsresult nsMenuItemX::DispatchDOMEvent(const nsString &eventName, PRBool *preven
|
||||
}
|
||||
|
||||
// get interface for creating DOM events from content owner document
|
||||
nsCOMPtr<nsIDOMDocumentEvent> DOMEventFactory = do_QueryInterface(parentDoc);
|
||||
if (!DOMEventFactory) {
|
||||
NS_WARNING("Failed to QI parent nsIDocument to nsIDOMDocumentEvent");
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(parentDoc);
|
||||
if (!domDoc) {
|
||||
NS_WARNING("Failed to QI parent nsIDocument to nsIDOMDocument");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// create DOM event
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsresult rv = DOMEventFactory->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
nsresult rv = domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to create nsIDOMEvent");
|
||||
return rv;
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "nsCocoaWindow.h"
|
||||
#include "nsWidgetAtoms.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
@ -57,11 +57,11 @@ void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
|
||||
NS_PRECONDITION(aTargetContent, "null ptr");
|
||||
|
||||
nsIDocument* doc = aTargetContent->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(doc);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc);
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTargetContent);
|
||||
if (docEvent && target) {
|
||||
if (domDoc && target) {
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryInterface(event);
|
||||
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(command);
|
||||
|
@ -58,7 +58,6 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMBarProp.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMXULDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
@ -272,18 +271,17 @@ NS_IMETHODIMP nsXULWindow::SetZLevel(PRUint32 aLevel)
|
||||
nsCOMPtr<nsIContentViewer> cv;
|
||||
mDocShell->GetContentViewer(getter_AddRefs(cv));
|
||||
if (cv) {
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent(
|
||||
do_QueryInterface(cv->GetDocument()));
|
||||
if (docEvent) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(cv->GetDocument());
|
||||
if (domDoc) {
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
if (event) {
|
||||
event->InitEvent(NS_LITERAL_STRING("windowZLevel"), PR_TRUE, PR_FALSE);
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
privateEvent->SetTrusted(PR_TRUE);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> targ(do_QueryInterface(docEvent));
|
||||
nsCOMPtr<nsIDOMEventTarget> targ = do_QueryInterface(domDoc);
|
||||
if (targ) {
|
||||
PRBool defaultActionEnabled;
|
||||
targ->DispatchEvent(event, &defaultActionEnabled);
|
||||
|
Loading…
Reference in New Issue
Block a user