зеркало из https://github.com/mozilla/gecko-dev.git
[Bug 857884] Use dom::EventTarget more instead of nsIDOMEventTarget Part 7 r=Ms2ger
This commit is contained in:
Родитель
e274b7c588
Коммит
6411801815
|
@ -52,7 +52,6 @@ class nsIDocumentObserver;
|
|||
class nsIDOMDocument;
|
||||
class nsIDOMDocumentFragment;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMEventTarget;
|
||||
class nsIDOMHTMLFormElement;
|
||||
class nsIDOMHTMLInputElement;
|
||||
class nsIDOMKeyEvent;
|
||||
|
@ -954,7 +953,7 @@ public:
|
|||
bool aCanBubble,
|
||||
bool aCancelable,
|
||||
bool *aDefaultAction = nullptr);
|
||||
|
||||
|
||||
/**
|
||||
* This method creates and dispatches a untrusted event.
|
||||
* Works only with events which can be created by calling
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#ifndef FileIOObject_h__
|
||||
#define FileIOObject_h__
|
||||
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsDOMEventTargetHelper.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIFile.h"
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIDOMHTMLInputElement.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "nsStubDocumentObserver.h"
|
||||
#include "nsIDOMStyleSheetList.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
#include "nsIDOMNodeSelector.h"
|
||||
|
@ -1155,7 +1154,7 @@ protected:
|
|||
|
||||
// Return whether all the presshells for this document are safe to flush
|
||||
bool IsSafeToFlush() const;
|
||||
|
||||
|
||||
void DispatchPageTransition(mozilla::dom::EventTarget* aDispatchTarget,
|
||||
const nsAString& aType,
|
||||
bool aPersisted);
|
||||
|
@ -1168,7 +1167,7 @@ protected:
|
|||
#define NS_DOCUMENT_NOTIFY_OBSERVERS(func_, params_) \
|
||||
NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers, nsIDocumentObserver, \
|
||||
func_, params_);
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
void VerifyRootContentState();
|
||||
#endif
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIExternalProtocolHandler.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIObjectFrame.h"
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include "nsIVariant.h"
|
||||
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
class nsEventTargetChainItem;
|
||||
class nsIDOMEvent;
|
||||
class nsIDOMEventTarget;
|
||||
class nsIScriptGlobalObject;
|
||||
class nsPresContext;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsIJSNativeInitializer.h"
|
||||
#include "mozilla/dom/EventTarget.h"
|
||||
#include "mozilla/dom/EventBinding.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
||||
class nsIContent;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define nsDOMMutationEvent_h__
|
||||
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsDOMEvent.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "mozilla/dom/MutationEventBinding.h"
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsIDOMWheelEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMUIEvent.h"
|
||||
#include "nsDOMDragEvent.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "mozilla/dom/HTMLButtonElementBinding.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsIDOMHTMLHRElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsMappedAttributes.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsRuleData.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/HTMLImageElementBinding.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#include "nsLayoutUtils.h"
|
||||
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsAsyncDOMEvent.h"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "mozilla/dom/HTMLOptGroupElement.h"
|
||||
#include "mozilla/dom/HTMLOptGroupElementBinding.h"
|
||||
#include "mozilla/dom/HTMLSelectElement.h" // SafeOptionListMutation
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIFrame.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "mozilla/dom/HTMLSelectElement.h"
|
||||
#include "nsIDOMHTMLOptGroupElement.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIFormControl.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "nsGUIEvent.h"
|
||||
#include "nsIComboboxControlFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMHTMLOptGroupElement.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIForm.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* 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.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIDocument.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "nsGUIEvent.h"
|
||||
#include "nsIComboboxControlFrame.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIFormControlFrame.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsIFormProcessor.h"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
#include "mozilla/dom/HTMLOListElementBinding.h"
|
||||
#include "mozilla/dom/HTMLUListElementBinding.h"
|
||||
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#define mozilla_dom_HTMLSpanElement_h
|
||||
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "mozilla/dom/HTMLStyleElement.h"
|
||||
#include "mozilla/dom/HTMLStyleElementBinding.h"
|
||||
#include "nsIDOMLinkStyle.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsIDOMStyleSheet.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsIFormControl.h"
|
||||
#include "nsIForm.h"
|
||||
#include "nsFormSubmission.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsPresContext.h"
|
||||
|
|
|
@ -80,7 +80,7 @@ protected:
|
|||
{
|
||||
public:
|
||||
TitleChangedListener(nsGenericHTMLFrameElement *aElement,
|
||||
nsIDOMEventTarget *aChromeHandler);
|
||||
mozilla::dom::EventTarget *aChromeHandler);
|
||||
|
||||
/* Unregister this listener. */
|
||||
void Unregister();
|
||||
|
@ -90,7 +90,7 @@ protected:
|
|||
|
||||
private:
|
||||
nsWeakPtr mElement; /* nsGenericHTMLFrameElement */
|
||||
nsWeakPtr mChromeHandler; /* nsIDOMEventTarget */
|
||||
nsWeakPtr mChromeHandler; /* EventTarget */
|
||||
};
|
||||
|
||||
// This doesn't really ensure a frame loade in all cases, only when
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#include "nsHTMLFormElement.h"
|
||||
#include "nsIHTMLDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsEventStateManager.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "mozilla/dom/SVGTests.h"
|
||||
#include "nsICSSDeclaration.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsMutationEvent.h"
|
||||
#include "nsError.h"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsHashtable.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "nsIDOMHTMLInputElement.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPIWindowRoot.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsXBLService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -11,9 +11,7 @@
|
|||
|
||||
class nsIAtom;
|
||||
class nsIDOMElement;
|
||||
class nsIDOMEventTarget;
|
||||
class nsIDOMKeyEvent;
|
||||
class nsIDOMEventTarget;
|
||||
class nsXBLSpecialDocInfo;
|
||||
class nsXBLPrototypeHandler;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "nsINodeInfo.h"
|
||||
#include "nsIControllers.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsIDOMXULMultSelectCntrlEl.h"
|
||||
#include "nsEventListenerManager.h"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "mozilla/dom/XMLDocument.h"
|
||||
#include "nsForwardReference.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMXULCommandDispatcher.h"
|
||||
#include "nsIDOMXULDocument.h"
|
||||
#include "nsCOMArray.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsRDFCID.h"
|
||||
#include "nsXULCommandDispatcher.h"
|
||||
#include "prlog.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMXPathNSResolver.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIContent.h"
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
#include "nsISecureBrowserUI.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsDocShellLoadTypes.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIWebShellServices.h"
|
||||
|
@ -79,6 +78,12 @@
|
|||
#include "nsICommandManager.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class EventTarget;
|
||||
}
|
||||
}
|
||||
|
||||
class nsDocShell;
|
||||
class nsDOMNavigationTiming;
|
||||
class nsGlobalWindow;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "TimeStamp.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
|
||||
nsDOMNavigationTiming::nsDOMNavigationTiming()
|
||||
|
|
|
@ -22,7 +22,6 @@ class nsPIDOMWindow;
|
|||
#include "nsString.h"
|
||||
#include "nsWeakPtr.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "StaticPtr.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "nsIWebBrowserChromeFocus.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsIWindowProvider.h"
|
||||
#include "nsIXPCScriptable.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "nsIDOMApplicationRegistry.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMHTMLFrameElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDialogCreator.h"
|
||||
|
|
|
@ -34,7 +34,6 @@ using mozilla::DefaultXDisplay;
|
|||
#include "nsDisplayList.h"
|
||||
#include "ImageLayers.h"
|
||||
#include "SharedTextureImage.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsObjectFrame.h"
|
||||
#include "nsIPluginDocument.h"
|
||||
#include "nsIStringStream.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "PowerManager.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "nsVariant.h"
|
||||
#include "nsIDOMBeforeUnloadEvent.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIJSContextStack.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
#include "nsIAlertsService.h"
|
||||
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIContentPermissionPrompt.h"
|
||||
|
||||
#include "nsIObserver.h"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include "nsAutoPtr.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsDOMGamepad.h"
|
||||
#include "nsIDOMGamepadButtonEvent.h"
|
||||
#include "nsIDOMGamepadAxisMoveEvent.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsIDOMWindow.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "GeneratedEvents.h"
|
||||
|
|
|
@ -66,20 +66,22 @@
|
|||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIConstraintValidation.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsDOMEvent.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
//
|
||||
// GetEventReceiver
|
||||
//
|
||||
// A helper routine that navigates the tricky path from a |nsWebBrowser| to
|
||||
// a |nsIDOMEventTarget| via the window root and chrome event handler.
|
||||
// a |EventTarget| via the window root and chrome event handler.
|
||||
//
|
||||
static nsresult
|
||||
GetDOMEventTarget( nsWebBrowser* inBrowser, nsIDOMEventTarget** aTarget)
|
||||
GetDOMEventTarget(nsWebBrowser* inBrowser, EventTarget** aTarget)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(inBrowser);
|
||||
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
inBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
|
||||
NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
|
||||
|
@ -88,11 +90,11 @@ GetDOMEventTarget( nsWebBrowser* inBrowser, nsIDOMEventTarget** aTarget)
|
|||
NS_ENSURE_TRUE(domWindowPrivate, NS_ERROR_FAILURE);
|
||||
nsPIDOMWindow *rootWindow = domWindowPrivate->GetPrivateRoot();
|
||||
NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDOMEventTarget> target =
|
||||
nsCOMPtr<EventTarget> target =
|
||||
rootWindow->GetChromeEventHandler();
|
||||
NS_ENSURE_TRUE(target, NS_ERROR_FAILURE);
|
||||
target.forget(aTarget);
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -852,7 +854,7 @@ nsDocShellTreeOwner::AddChromeListeners()
|
|||
}
|
||||
|
||||
// register dragover and drop event listeners with the listener manager
|
||||
nsCOMPtr<nsIDOMEventTarget> target;
|
||||
nsCOMPtr<EventTarget> target;
|
||||
GetDOMEventTarget(mWebBrowser, getter_AddRefs(target));
|
||||
|
||||
nsEventListenerManager* elmP = target->GetListenerManager(true);
|
||||
|
@ -864,7 +866,7 @@ nsDocShellTreeOwner::AddChromeListeners()
|
|||
}
|
||||
|
||||
return rv;
|
||||
|
||||
|
||||
} // AddChromeListeners
|
||||
|
||||
|
||||
|
@ -880,7 +882,7 @@ nsDocShellTreeOwner::RemoveChromeListeners()
|
|||
NS_RELEASE(mChromeContextMenuListener);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> piTarget;
|
||||
nsCOMPtr<EventTarget> piTarget;
|
||||
GetDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget));
|
||||
if (!piTarget)
|
||||
return NS_OK;
|
||||
|
@ -1159,10 +1161,10 @@ ChromeTooltipListener::~ChromeTooltipListener()
|
|||
//
|
||||
NS_IMETHODIMP
|
||||
ChromeTooltipListener::AddChromeListeners()
|
||||
{
|
||||
{
|
||||
if (!mEventTarget)
|
||||
GetDOMEventTarget(mWebBrowser, getter_AddRefs(mEventTarget));
|
||||
|
||||
|
||||
// Register the appropriate events for tooltips, but only if
|
||||
// the embedding chrome cares.
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -1172,9 +1174,9 @@ ChromeTooltipListener::AddChromeListeners()
|
|||
if ( NS_FAILED(rv) )
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
return rv;
|
||||
|
||||
|
||||
} // AddChromeListeners
|
||||
|
||||
|
||||
|
@ -1314,8 +1316,7 @@ ChromeTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent)
|
|||
|
||||
mTooltipTimer = do_CreateInstance("@mozilla.org/timer;1");
|
||||
if ( mTooltipTimer ) {
|
||||
nsCOMPtr<nsIDOMEventTarget> eventTarget;
|
||||
aMouseEvent->GetTarget(getter_AddRefs(eventTarget));
|
||||
nsCOMPtr<EventTarget> eventTarget = aMouseEvent->InternalDOMEvent()->GetTarget();
|
||||
if ( eventTarget )
|
||||
mPossibleTooltipNode = do_QueryInterface(eventTarget);
|
||||
if ( mPossibleTooltipNode ) {
|
||||
|
@ -1329,9 +1330,9 @@ ChromeTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent)
|
|||
}
|
||||
else
|
||||
NS_WARNING ( "Could not create a timer for tooltip tracking" );
|
||||
|
||||
|
||||
return NS_OK;
|
||||
|
||||
|
||||
} // MouseMove
|
||||
|
||||
|
||||
|
@ -1588,10 +1589,10 @@ ChromeContextMenuListener::RemoveContextMenuListener()
|
|||
//
|
||||
NS_IMETHODIMP
|
||||
ChromeContextMenuListener::AddChromeListeners()
|
||||
{
|
||||
{
|
||||
if (!mEventTarget)
|
||||
GetDOMEventTarget(mWebBrowser, getter_AddRefs(mEventTarget));
|
||||
|
||||
|
||||
// Register the appropriate events for context menus, but only if
|
||||
// the embedding chrome cares.
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -1602,7 +1603,7 @@ ChromeContextMenuListener::AddChromeListeners()
|
|||
rv = AddContextMenuListener();
|
||||
|
||||
return rv;
|
||||
|
||||
|
||||
} // AddChromeListeners
|
||||
|
||||
|
||||
|
@ -1645,10 +1646,7 @@ ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> targetNode;
|
||||
nsresult res = aMouseEvent->GetTarget(getter_AddRefs(targetNode));
|
||||
if (NS_FAILED(res))
|
||||
return res;
|
||||
nsCOMPtr<EventTarget> targetNode = aMouseEvent->InternalDOMEvent()->GetTarget();
|
||||
if (!targetNode)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
@ -1659,7 +1657,7 @@ ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
|||
|
||||
// Stop the context menu event going to other windows (bug 78396)
|
||||
aMouseEvent->PreventDefault();
|
||||
|
||||
|
||||
// If the listener is a nsIContextMenuListener2, create the info object
|
||||
nsCOMPtr<nsIContextMenuListener2> menuListener2(do_QueryInterface(mWebBrowserChrome));
|
||||
nsContextMenuInfo *menuInfoImpl = nullptr;
|
||||
|
@ -1675,7 +1673,7 @@ ChromeContextMenuListener::HandleEvent(nsIDOMEvent* aMouseEvent)
|
|||
// XXX test for selected text
|
||||
|
||||
uint16_t nodeType;
|
||||
res = node->GetNodeType(&nodeType);
|
||||
nsresult res = node->GetNodeType(&nodeType);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
// First, checks for nodes that never have children.
|
||||
|
|
|
@ -28,9 +28,14 @@
|
|||
#include "nsITooltipTextProvider.h"
|
||||
#include "nsCTooltipTextProvider.h"
|
||||
#include "nsIDroppedLinkHandler.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsCommandHandler.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class EventTarget;
|
||||
}
|
||||
}
|
||||
|
||||
class nsWebBrowser;
|
||||
class ChromeTooltipListener;
|
||||
class ChromeContextMenuListener;
|
||||
|
@ -169,9 +174,9 @@ private:
|
|||
NS_IMETHOD HideTooltip ( ) ;
|
||||
|
||||
nsWebBrowser* mWebBrowser;
|
||||
nsCOMPtr<nsIDOMEventTarget> mEventTarget;
|
||||
nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;
|
||||
nsCOMPtr<nsITooltipTextProvider> mTooltipTextProvider;
|
||||
|
||||
|
||||
// This must be a strong ref in order to make sure we can hide the tooltip
|
||||
// if the window goes away while we're displaying one. If we don't hold
|
||||
// a strong ref, the chrome might have been disposed of before we get a chance
|
||||
|
@ -235,7 +240,7 @@ private:
|
|||
bool mContextMenuListenerInstalled;
|
||||
|
||||
nsWebBrowser* mWebBrowser;
|
||||
nsCOMPtr<nsIDOMEventTarget> mEventTarget;
|
||||
nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;
|
||||
nsCOMPtr<nsIWebBrowserChrome> mWebBrowserChrome;
|
||||
|
||||
}; // class ChromeContextMenuListener
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPIWindowRoot.h"
|
||||
#include "nsIFocusManager.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
|
||||
#include "nsCOMArray.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsString.h"
|
||||
#include "nsGUIEvent.h"
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIDOMKeyEvent.h"
|
||||
#include "nsIDOMNode.h"
|
||||
|
@ -64,6 +63,8 @@
|
|||
#include "nsContentUtils.h"
|
||||
#include "nsEditor.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
// Set to spew messages to the console about what is happening.
|
||||
//#define DEBUG_INLINESPELL
|
||||
|
||||
|
@ -608,7 +609,7 @@ mozInlineSpellChecker::RegisterEventListeners()
|
|||
nsresult rv = editor->GetDocument(getter_AddRefs(doc));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(doc, &rv);
|
||||
nsCOMPtr<EventTarget> piTarget = do_QueryInterface(doc, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
piTarget->AddEventListener(NS_LITERAL_STRING("blur"), this,
|
||||
|
@ -633,8 +634,8 @@ mozInlineSpellChecker::UnregisterEventListeners()
|
|||
nsCOMPtr<nsIDOMDocument> doc;
|
||||
editor->GetDocument(getter_AddRefs(doc));
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_NULL_POINTER);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(doc);
|
||||
|
||||
nsCOMPtr<EventTarget> piTarget = do_QueryInterface(doc);
|
||||
NS_ENSURE_TRUE(piTarget, NS_ERROR_NULL_POINTER);
|
||||
|
||||
piTarget->RemoveEventListener(NS_LITERAL_STRING("blur"), this, true);
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
#include "p12plcy.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::psm;
|
||||
|
||||
#ifdef MOZ_LOGGING
|
||||
|
@ -537,8 +538,8 @@ nsNSSComponent::DispatchEventToWindow(nsIDOMWindow *domWin,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
smartCardEvent->SetTrusted(true);
|
||||
|
||||
// Send it
|
||||
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(doc, &rv);
|
||||
// Send it
|
||||
nsCOMPtr<EventTarget> target = do_QueryInterface(doc, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "nsWeakReference.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#ifndef MOZ_DISABLE_CRYPTOLEGACY
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsSmartCardMonitor.h"
|
||||
#endif
|
||||
#include "nsINSSErrorsService.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "nsIWidget.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
nsMenuItemX::nsMenuItemX()
|
||||
|
@ -346,7 +345,7 @@ nsresult nsMenuItemX::DispatchDOMEvent(const nsString &eventName, bool *preventD
|
|||
// send DOM event
|
||||
rv = mContent->DispatchEvent(event, preventDefaultCalled);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to send DOM event via nsIDOMEventTarget");
|
||||
NS_WARNING("Failed to send DOM event via EventTarget");
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "nsGkAtoms.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "nsCOMArray.h"
|
||||
#include "nsPoint.h"
|
||||
#include "nsRect.h"
|
||||
#include "nsRegion.h"
|
||||
#include "nsEvent.h"
|
||||
#include "nsStringGlue.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIXULWindow.h"
|
||||
#include "nsRegion.h"
|
||||
|
||||
class nsView;
|
||||
class nsIPresShell;
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include "nsEscape.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIWebNavigation.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
|
||||
|
@ -77,6 +76,7 @@
|
|||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
/* Define Class IDs */
|
||||
static NS_DEFINE_CID(kWindowCID, NS_WINDOW_CID);
|
||||
|
@ -294,7 +294,7 @@ nsWebShellWindow::RequestWindowClose(nsIWidget* aWidget)
|
|||
nsCOMPtr<nsIXULWindow> xulWindow(this);
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
|
||||
nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(window);
|
||||
nsCOMPtr<EventTarget> eventTarget = do_QueryInterface(window);
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||
|
||||
|
@ -682,7 +682,7 @@ bool nsWebShellWindow::ExecuteCloseHandler()
|
|||
nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this);
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
|
||||
nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(window);
|
||||
nsCOMPtr<EventTarget> eventTarget = do_QueryInterface(window);
|
||||
|
||||
if (eventTarget) {
|
||||
nsCOMPtr<nsIContentViewer> contentViewer;
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMXULDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMScreen.h"
|
||||
|
@ -53,6 +52,7 @@
|
|||
#include "nsPresContext.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsWebShellWindow.h" // get rid of this one, too...
|
||||
#include "nsDOMEvent.h"
|
||||
|
||||
#include "prenv.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
@ -225,20 +225,17 @@ NS_IMETHODIMP nsXULWindow::SetZLevel(uint32_t aLevel)
|
|||
nsCOMPtr<nsIContentViewer> cv;
|
||||
mDocShell->GetContentViewer(getter_AddRefs(cv));
|
||||
if (cv) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(cv->GetDocument());
|
||||
if (domDoc) {
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDocument> doc = cv->GetDocument();
|
||||
if (doc) {
|
||||
ErrorResult rv;
|
||||
nsRefPtr<nsDOMEvent> event = doc->CreateEvent(NS_LITERAL_STRING("Events"),rv);
|
||||
if (event) {
|
||||
event->InitEvent(NS_LITERAL_STRING("windowZLevel"), true, false);
|
||||
|
||||
event->SetTrusted(true);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> targ = do_QueryInterface(domDoc);
|
||||
if (targ) {
|
||||
bool defaultActionEnabled;
|
||||
targ->DispatchEvent(event, &defaultActionEnabled);
|
||||
}
|
||||
bool defaultActionEnabled;
|
||||
doc->DispatchEvent(event, &defaultActionEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче