Bug 658714 Part 5: Search'n'replace nsPIDOMEventTarget to nsIDOMEventTarget. r=smaug

This commit is contained in:
Jonas Sicking 2011-06-23 19:18:00 -07:00
Родитель d16541209b
Коммит 07c1f0b90f
67 изменённых файлов: 178 добавлений и 360 удалений

Просмотреть файл

@ -391,7 +391,7 @@ nsAccDocManager::AddListeners(nsIDocument *aDocument,
PRBool aAddDOMContentLoadedListener) PRBool aAddDOMContentLoadedListener)
{ {
nsPIDOMWindow *window = aDocument->GetWindow(); nsPIDOMWindow *window = aDocument->GetWindow();
nsPIDOMEventTarget *target = window->GetChromeEventHandler(); nsIDOMEventTarget *target = window->GetChromeEventHandler();
nsIEventListenerManager* elm = target->GetListenerManager(PR_TRUE); nsIEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"), elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
NS_EVENT_FLAG_CAPTURE, nsnull); NS_EVENT_FLAG_CAPTURE, nsnull);

Просмотреть файл

@ -69,15 +69,15 @@ public:
static nsDOMEventTargetWrapperCache* FromSupports(nsISupports* aSupports) static nsDOMEventTargetWrapperCache* FromSupports(nsISupports* aSupports)
{ {
nsPIDOMEventTarget* target = nsIDOMEventTarget* target =
static_cast<nsPIDOMEventTarget*>(aSupports); static_cast<nsIDOMEventTarget*>(aSupports);
#ifdef DEBUG #ifdef DEBUG
{ {
nsCOMPtr<nsPIDOMEventTarget> target_qi = nsCOMPtr<nsIDOMEventTarget> target_qi =
do_QueryInterface(aSupports); do_QueryInterface(aSupports);
// If this assertion fires the QI implementation for the object in // If this assertion fires the QI implementation for the object in
// question doesn't use the nsPIDOMEventTarget pointer as the // question doesn't use the nsIDOMEventTarget pointer as the
// nsISupports pointer. That must be fixed, or we'll crash... // nsISupports pointer. That must be fixed, or we'll crash...
NS_ASSERTION(target_qi == target, "Uh, fix QI!"); NS_ASSERTION(target_qi == target, "Uh, fix QI!");
} }

Просмотреть файл

@ -38,7 +38,7 @@
#ifndef nsINode_h___ #ifndef nsINode_h___
#define nsINode_h___ #define nsINode_h___
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsEvent.h" #include "nsEvent.h"
#include "nsPropertyTable.h" #include "nsPropertyTable.h"
#include "nsTObserverArray.h" #include "nsTObserverArray.h"

Просмотреть файл

@ -2509,7 +2509,7 @@ IsContextOnStack(nsIJSContextStack *aStack, JSContext *aContext)
} }
PRBool PRBool
nsCxPusher::Push(nsPIDOMEventTarget *aCurrentTarget) nsCxPusher::Push(nsIDOMEventTarget *aCurrentTarget)
{ {
if (mPushedSomething) { if (mPushedSomething) {
NS_ERROR("Whaaa! No double pushing with nsCxPusher::Push()!"); NS_ERROR("Whaaa! No double pushing with nsCxPusher::Push()!");
@ -2551,7 +2551,7 @@ nsCxPusher::Push(nsPIDOMEventTarget *aCurrentTarget)
} }
PRBool PRBool
nsCxPusher::RePush(nsPIDOMEventTarget *aCurrentTarget) nsCxPusher::RePush(nsIDOMEventTarget *aCurrentTarget)
{ {
if (!mPushedSomething) { if (!mPushedSomething) {
return Push(aCurrentTarget); return Push(aCurrentTarget);
@ -3050,7 +3050,7 @@ nsContentUtils::DispatchChromeEvent(nsIDocument *aDoc,
if (!aDoc->GetWindow()) if (!aDoc->GetWindow())
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
nsPIDOMEventTarget* piTarget = aDoc->GetWindow()->GetChromeEventHandler(); nsIDOMEventTarget* piTarget = aDoc->GetWindow()->GetChromeEventHandler();
if (!piTarget) if (!piTarget)
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
@ -3058,7 +3058,7 @@ nsContentUtils::DispatchChromeEvent(nsIDocument *aDoc,
if (flo) { if (flo) {
nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader(); nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
if (fl) { if (fl) {
nsPIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget(); nsIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
piTarget = t ? t : piTarget; piTarget = t ? t : piTarget;
} }
} }
@ -3242,7 +3242,7 @@ nsContentUtils::HasMutationListeners(nsINode* aNode,
// If we have a window, we can check it for mutation listeners now. // If we have a window, we can check it for mutation listeners now.
if (aNode->IsInDoc()) { if (aNode->IsInDoc()) {
nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(window)); nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(window));
if (piTarget) { if (piTarget) {
nsIEventListenerManager* manager = piTarget->GetListenerManager(PR_FALSE); nsIEventListenerManager* manager = piTarget->GetListenerManager(PR_FALSE);
if (manager) { if (manager) {

Просмотреть файл

@ -43,7 +43,7 @@
nsDOMEventTargetWrapperCache::~nsDOMEventTargetWrapperCache() nsDOMEventTargetWrapperCache::~nsDOMEventTargetWrapperCache()
{ {
nsISupports *supports = static_cast<nsPIDOMEventTarget*>(this); nsISupports *supports = static_cast<nsIDOMEventTarget*>(this);
nsContentUtils::ReleaseWrapper(supports, this); nsContentUtils::ReleaseWrapper(supports, this);
} }

Просмотреть файл

@ -6235,7 +6235,7 @@ nsDocument::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
// Load events must not propagate to |window| object, see bug 335251. // Load events must not propagate to |window| object, see bug 335251.
if (aVisitor.mEvent->message != NS_LOAD) { if (aVisitor.mEvent->message != NS_LOAD) {
nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow()); nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
aVisitor.mParentTarget = static_cast<nsPIDOMEventTarget*>(window); aVisitor.mParentTarget = static_cast<nsIDOMEventTarget*>(window);
} }
return NS_OK; return NS_OK;
} }
@ -6999,7 +6999,7 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest)
} }
// Check our event listener manager for unload/beforeunload listeners. // Check our event listener manager for unload/beforeunload listeners.
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(mScriptGlobalObject); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(mScriptGlobalObject);
if (piTarget) { if (piTarget) {
nsIEventListenerManager* manager = nsIEventListenerManager* manager =
piTarget->GetListenerManager(PR_FALSE); piTarget->GetListenerManager(PR_FALSE);
@ -7311,7 +7311,7 @@ nsDocument::CheckAncestryAndGetFrame(nsIDocument* aDocument) const
} }
void void
nsDocument::DispatchPageTransition(nsPIDOMEventTarget* aDispatchTarget, nsDocument::DispatchPageTransition(nsIDOMEventTarget* aDispatchTarget,
const nsAString& aType, const nsAString& aType,
PRBool aPersisted) PRBool aPersisted)
{ {
@ -7381,7 +7381,7 @@ nsDocument::OnPageShow(PRBool aPersisted,
SetImagesNeedAnimating(PR_TRUE); SetImagesNeedAnimating(PR_TRUE);
} }
nsCOMPtr<nsPIDOMEventTarget> target = nsCOMPtr<nsIDOMEventTarget> target =
aDispatchStartTarget ? do_QueryInterface(aDispatchStartTarget) : aDispatchStartTarget ? do_QueryInterface(aDispatchStartTarget) :
do_QueryInterface(GetWindow()); do_QueryInterface(GetWindow());
DispatchPageTransition(target, NS_LITERAL_STRING("pageshow"), aPersisted); DispatchPageTransition(target, NS_LITERAL_STRING("pageshow"), aPersisted);
@ -7434,7 +7434,7 @@ nsDocument::OnPageHide(PRBool aPersisted,
} }
// Now send out a PageHide event. // Now send out a PageHide event.
nsCOMPtr<nsPIDOMEventTarget> target = nsCOMPtr<nsIDOMEventTarget> target =
aDispatchStartTarget ? do_QueryInterface(aDispatchStartTarget) : aDispatchStartTarget ? do_QueryInterface(aDispatchStartTarget) :
do_QueryInterface(GetWindow()); do_QueryInterface(GetWindow());
DispatchPageTransition(target, NS_LITERAL_STRING("pagehide"), aPersisted); DispatchPageTransition(target, NS_LITERAL_STRING("pagehide"), aPersisted);

Просмотреть файл

@ -997,7 +997,7 @@ protected:
return kNameSpaceID_None; return kNameSpaceID_None;
} }
void DispatchPageTransition(nsPIDOMEventTarget* aDispatchTarget, void DispatchPageTransition(nsIDOMEventTarget* aDispatchTarget,
const nsAString& aType, const nsAString& aType,
PRBool aPersisted); PRBool aPersisted);

Просмотреть файл

@ -1904,9 +1904,9 @@ public:
nsInProcessTabChildGlobal* tabChild = nsInProcessTabChildGlobal* tabChild =
static_cast<nsInProcessTabChildGlobal*>(mFrameLoader->mChildMessageManager.get()); static_cast<nsInProcessTabChildGlobal*>(mFrameLoader->mChildMessageManager.get());
if (tabChild && tabChild->GetInnerManager()) { if (tabChild && tabChild->GetInnerManager()) {
nsFrameScriptCx cx(static_cast<nsPIDOMEventTarget*>(tabChild), tabChild); nsFrameScriptCx cx(static_cast<nsIDOMEventTarget*>(tabChild), tabChild);
nsRefPtr<nsFrameMessageManager> mm = tabChild->GetInnerManager(); nsRefPtr<nsFrameMessageManager> mm = tabChild->GetInnerManager();
mm->ReceiveMessage(static_cast<nsPIDOMEventTarget*>(tabChild), mMessage, mm->ReceiveMessage(static_cast<nsIDOMEventTarget*>(tabChild), mMessage,
PR_FALSE, mJSON, nsnull, nsnull); PR_FALSE, mJSON, nsnull, nsnull);
} }
return NS_OK; return NS_OK;
@ -2056,7 +2056,7 @@ nsFrameLoader::EnsureMessageManager()
return NS_OK; return NS_OK;
} }
nsPIDOMEventTarget* nsIDOMEventTarget*
nsFrameLoader::GetTabChildGlobalAsEventTarget() nsFrameLoader::GetTabChildGlobalAsEventTarget()
{ {
return static_cast<nsInProcessTabChildGlobal*>(mChildMessageManager.get()); return static_cast<nsInProcessTabChildGlobal*>(mChildMessageManager.get());

Просмотреть файл

@ -196,7 +196,7 @@ public:
nsresult ReallyStartLoading(); nsresult ReallyStartLoading();
void Finalize(); void Finalize();
nsIDocShell* GetExistingDocShell() { return mDocShell; } nsIDocShell* GetExistingDocShell() { return mDocShell; }
nsPIDOMEventTarget* GetTabChildGlobalAsEventTarget(); nsIDOMEventTarget* GetTabChildGlobalAsEventTarget();
nsresult CreateStaticClone(nsIFrameLoader* aDest); nsresult CreateStaticClone(nsIFrameLoader* aDest);
/** /**

Просмотреть файл

@ -309,7 +309,7 @@ nsInProcessTabChildGlobal::InitTabChildGlobal()
nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT; nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT;
nsISupports* scopeSupports = nsISupports* scopeSupports =
NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, this); NS_ISUPPORTS_CAST(nsIDOMEventTarget*, this);
JS_SetContextPrivate(cx, scopeSupports); JS_SetContextPrivate(cx, scopeSupports);
nsresult rv = nsresult rv =

Просмотреть файл

@ -1127,10 +1127,10 @@ nsWebSocket::UpdateMustKeepAlive()
if (mKeepingAlive && !shouldKeepAlive) { if (mKeepingAlive && !shouldKeepAlive) {
mKeepingAlive = PR_FALSE; mKeepingAlive = PR_FALSE;
static_cast<nsPIDOMEventTarget*>(this)->Release(); static_cast<nsIDOMEventTarget*>(this)->Release();
} else if (!mKeepingAlive && shouldKeepAlive) { } else if (!mKeepingAlive && shouldKeepAlive) {
mKeepingAlive = PR_TRUE; mKeepingAlive = PR_TRUE;
static_cast<nsPIDOMEventTarget*>(this)->AddRef(); static_cast<nsIDOMEventTarget*>(this)->AddRef();
} }
} }
@ -1140,7 +1140,7 @@ nsWebSocket::DontKeepAliveAnyMore()
NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread"); NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
if (mKeepingAlive) { if (mKeepingAlive) {
mKeepingAlive = PR_FALSE; mKeepingAlive = PR_FALSE;
static_cast<nsPIDOMEventTarget*>(this)->Release(); static_cast<nsIDOMEventTarget*>(this)->Release();
} }
mCheckMustKeepAlive = PR_FALSE; mCheckMustKeepAlive = PR_FALSE;
} }

Просмотреть файл

@ -53,7 +53,6 @@ EXPORTS = \
nsIPrivateTextRange.h \ nsIPrivateTextRange.h \
nsPLDOMEvent.h \ nsPLDOMEvent.h \
nsEventDispatcher.h \ nsEventDispatcher.h \
nsPIDOMEventTarget.h \
nsEventStates.h \ nsEventStates.h \
$(NULL) $(NULL)

Просмотреть файл

@ -1,181 +0,0 @@
/* -*- Mode: C++; 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 Mozilla.org.
* Portions created by the Initial Developer are Copyright (C) 2006
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Olli Pettay <Olli.Pettay@helsinki.fi> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either 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 ***** */
#ifndef nsPIDOMEventTarget_h_
#define nsPIDOMEventTarget_h_
#include "nsIDOMEventTarget.h"
#if 0
#include "nsEvent.h"
class nsIDOMEvent;
class nsPresContext;
class nsEventChainPreVisitor;
class nsEventChainPostVisitor;
class nsIEventListenerManager;
class nsIDOMEventListener;
class nsIDOMEventGroup;
class nsIScriptContext;
struct JSContext;
// 89292f3a-535d-4ba0-882a-10cff9e21bcc
#define NS_PIDOMEVENTTARGET_IID \
{ 0x89292f3a, 0x535d, 0x4ba0, \
{ 0x88, 0x2a, 0x10, 0xcf, 0xf9, 0xe2, 0x1b, 0xcc } }
class nsPIDOMEventTarget : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMEVENTTARGET_IID)
/**
* Returns the nsPIDOMEventTarget object which should be used as the target
* of DOMEvents.
* Usually |this| is returned, but for example global object returns
* the outer object.
*/
virtual nsPIDOMEventTarget* GetTargetForDOMEvent() { return this; }
/**
* Returns the nsPIDOMEventTarget 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.
*/
virtual nsPIDOMEventTarget* GetTargetForEventTargetChain() { return this; }
/**
* 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 nsEventChainPreVisitor.
* 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 nsEventDispatcher.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 nsEventDispatcher should call this method.
*/
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor) = 0;
/**
* If nsEventChainPreVisitor.mWantsWillHandleEvent is set PR_TRUE,
* called just before possible event handlers on this object will be called.
*/
virtual nsresult WillHandleEvent(nsEventChainPostVisitor& aVisitor)
{
return NS_OK;
}
/**
* 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 nsEventDispatcher.h for documentation about aVisitor.
* @note Only nsEventDispatcher should call this method.
*/
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor) = 0;
/**
* 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 nsEvent.
* @param aPresContext the current presentation context, can be nsnull.
* @param aEventStatus the status returned from the function, can be nsnull.
*
* @note If both aEvent and aDOMEvent are used, aEvent must be the internal
* event of the aDOMEvent.
*
* If aDOMEvent is not nsnull (in which case aEvent can be nsnull) 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.
*/
virtual nsresult DispatchDOMEvent(nsEvent* aEvent,
nsIDOMEvent* aDOMEvent,
nsPresContext* aPresContext,
nsEventStatus* aEventStatus) = 0;
/**
* Get the event listener manager, the guy you talk to to register for events
* on this node.
* @param aMayCreate If PR_FALSE, returns a listener manager only if
* one already exists.
*/
virtual nsIEventListenerManager* GetListenerManager(PRBool aMayCreate) = 0;
/**
* Add an event listener for nsIID.
*/
virtual nsresult AddEventListenerByIID(nsIDOMEventListener *aListener,
const nsIID& aIID) = 0;
/**
* Remove event listener for nsIID.
*/
virtual nsresult RemoveEventListenerByIID(nsIDOMEventListener *aListener,
const nsIID& aIID) = 0;
/**
* Get the system event group.
*/
virtual nsresult GetSystemEventGroup(nsIDOMEventGroup** aGroup) = 0;
/**
* Get the script context in which the event handlers should be run.
* May return null.
* @note Caller *must* check the value of aRv.
*/
virtual nsIScriptContext* GetContextForEventHandlers(nsresult* aRv) = 0;
/**
* If the method above returns null, but a success code, this method
* is called.
*/
virtual JSContext* GetJSContextForEventHandlers() { return nsnull; }
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMEventTarget, NS_PIDOMEVENTTARGET_IID)
#endif
#endif // !defined(nsPIDOMEventTarget_h_)

Просмотреть файл

@ -469,7 +469,7 @@ nsDOMDataTransfer::MozGetDataAt(const nsAString& aFormat,
nsCOMPtr<nsISupports> data; nsCOMPtr<nsISupports> data;
formatitem.mData->GetAsISupports(getter_AddRefs(data)); formatitem.mData->GetAsISupports(getter_AddRefs(data));
// Make sure the code that is calling us is same-origin with the data. // Make sure the code that is calling us is same-origin with the data.
nsCOMPtr<nsPIDOMEventTarget> pt = do_QueryInterface(data); nsCOMPtr<nsIDOMEventTarget> pt = do_QueryInterface(data);
if (pt) { if (pt) {
nsresult rv = NS_OK; nsresult rv = NS_OK;
nsIScriptContext* c = pt->GetContextForEventHandlers(&rv); nsIScriptContext* c = pt->GetContextForEventHandlers(&rv);

Просмотреть файл

@ -280,10 +280,10 @@ NS_METHOD nsDOMEvent::GetType(nsAString& aType)
} }
static nsresult static nsresult
GetDOMEventTarget(nsPIDOMEventTarget* aTarget, GetDOMEventTarget(nsIDOMEventTarget* aTarget,
nsIDOMEventTarget** aDOMTarget) nsIDOMEventTarget** aDOMTarget)
{ {
nsPIDOMEventTarget* realTarget = nsIDOMEventTarget* realTarget =
aTarget ? aTarget->GetTargetForDOMEvent() : aTarget; aTarget ? aTarget->GetTargetForDOMEvent() : aTarget;
if (realTarget) { if (realTarget) {
return CallQueryInterface(realTarget, aDOMTarget); return CallQueryInterface(realTarget, aDOMTarget);

Просмотреть файл

@ -80,7 +80,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEventTargetHelper) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMEventTargetHelper)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsPIDOMEventTarget) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEventTarget)
NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget) NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
NS_INTERFACE_MAP_END NS_INTERFACE_MAP_END
@ -140,7 +140,7 @@ nsDOMEventTargetHelper::DispatchEvent(nsIDOMEvent* aEvent, PRBool* aRetVal)
{ {
nsEventStatus status = nsEventStatus_eIgnore; nsEventStatus status = nsEventStatus_eIgnore;
nsresult rv = nsresult rv =
nsEventDispatcher::DispatchDOMEvent(static_cast<nsPIDOMEventTarget*>(this), nsEventDispatcher::DispatchDOMEvent(static_cast<nsIDOMEventTarget*>(this),
nsnull, aEvent, nsnull, &status); nsnull, aEvent, nsnull, &status);
*aRetVal = (status != nsEventStatus_eConsumeNoDefault); *aRetVal = (status != nsEventStatus_eConsumeNoDefault);
@ -199,7 +199,7 @@ nsDOMEventTargetHelper::DispatchDOMEvent(nsEvent* aEvent,
nsEventStatus* aEventStatus) nsEventStatus* aEventStatus)
{ {
return return
nsEventDispatcher::DispatchDOMEvent(static_cast<nsPIDOMEventTarget*>(this), nsEventDispatcher::DispatchDOMEvent(static_cast<nsIDOMEventTarget*>(this),
aEvent, aDOMEvent, aPresContext, aEvent, aDOMEvent, aPresContext,
aEventStatus); aEventStatus);
} }
@ -213,7 +213,7 @@ nsDOMEventTargetHelper::GetListenerManager(PRBool aCreateIfNotFound)
} }
nsresult rv = NS_NewEventListenerManager(getter_AddRefs(mListenerManager)); nsresult rv = NS_NewEventListenerManager(getter_AddRefs(mListenerManager));
NS_ENSURE_SUCCESS(rv, nsnull); NS_ENSURE_SUCCESS(rv, nsnull);
mListenerManager->SetListenerTarget(static_cast<nsPIDOMEventTarget*>(this)); mListenerManager->SetListenerTarget(static_cast<nsIDOMEventTarget*>(this));
} }
return mListenerManager; return mListenerManager;

Просмотреть файл

@ -41,7 +41,7 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMEventListener.h" #include "nsIDOMEventListener.h"
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
@ -73,7 +73,7 @@ public:
virtual ~nsDOMEventTargetHelper() {} virtual ~nsDOMEventTargetHelper() {}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMEventTargetHelper, NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMEventTargetHelper,
nsPIDOMEventTarget) nsIDOMEventTarget)
NS_DECL_NSIDOMEVENTTARGET NS_DECL_NSIDOMEVENTTARGET

Просмотреть файл

@ -37,7 +37,7 @@
#include "nsEventDispatcher.h" #include "nsEventDispatcher.h"
#include "nsDOMEvent.h" #include "nsDOMEvent.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIPrivateDOMEvent.h" #include "nsIPrivateDOMEvent.h"
#include "nsEventListenerManager.h" #include "nsEventListenerManager.h"
@ -64,12 +64,12 @@ static nsEventTargetChainItem* gCachedETCI = nsnull;
class nsEventTargetChainItem class nsEventTargetChainItem
{ {
private: private:
nsEventTargetChainItem(nsPIDOMEventTarget* aTarget, nsEventTargetChainItem(nsIDOMEventTarget* aTarget,
nsEventTargetChainItem* aChild = nsnull); nsEventTargetChainItem* aChild = nsnull);
public: public:
static nsEventTargetChainItem* Create(nsFixedSizeAllocator* aAllocator, static nsEventTargetChainItem* Create(nsFixedSizeAllocator* aAllocator,
nsPIDOMEventTarget* aTarget, nsIDOMEventTarget* aTarget,
nsEventTargetChainItem* aChild = nsnull) nsEventTargetChainItem* aChild = nsnull)
{ {
void* place = nsnull; void* place = nsnull;
@ -109,12 +109,12 @@ public:
return !!(mTarget); return !!(mTarget);
} }
nsPIDOMEventTarget* GetNewTarget() nsIDOMEventTarget* GetNewTarget()
{ {
return mNewTarget; return mNewTarget;
} }
void SetNewTarget(nsPIDOMEventTarget* aNewTarget) void SetNewTarget(nsIDOMEventTarget* aNewTarget)
{ {
mNewTarget = aNewTarget; mNewTarget = aNewTarget;
} }
@ -161,7 +161,7 @@ public:
return !!(mFlags & NS_TARGET_CHAIN_MAY_HAVE_MANAGER); return !!(mFlags & NS_TARGET_CHAIN_MAY_HAVE_MANAGER);
} }
nsPIDOMEventTarget* CurrentTarget() nsIDOMEventTarget* CurrentTarget()
{ {
return mTarget; return mTarget;
} }
@ -232,7 +232,7 @@ public:
sMaxEtciCount = 0; sMaxEtciCount = 0;
} }
nsCOMPtr<nsPIDOMEventTarget> mTarget; nsCOMPtr<nsIDOMEventTarget> mTarget;
nsEventTargetChainItem* mChild; nsEventTargetChainItem* mChild;
union { union {
nsEventTargetChainItem* mParent; nsEventTargetChainItem* mParent;
@ -243,7 +243,7 @@ public:
PRUint16 mItemFlags; PRUint16 mItemFlags;
nsCOMPtr<nsISupports> mItemData; nsCOMPtr<nsISupports> mItemData;
// Event retargeting must happen whenever mNewTarget is non-null. // Event retargeting must happen whenever mNewTarget is non-null.
nsCOMPtr<nsPIDOMEventTarget> mNewTarget; nsCOMPtr<nsIDOMEventTarget> mNewTarget;
// Cache mTarget's event listener manager. // Cache mTarget's event listener manager.
nsRefPtr<nsEventListenerManager> mManager; nsRefPtr<nsEventListenerManager> mManager;
@ -254,7 +254,7 @@ public:
PRUint32 nsEventTargetChainItem::sMaxEtciCount = 0; PRUint32 nsEventTargetChainItem::sMaxEtciCount = 0;
PRUint32 nsEventTargetChainItem::sCurrentEtciCount = 0; PRUint32 nsEventTargetChainItem::sCurrentEtciCount = 0;
nsEventTargetChainItem::nsEventTargetChainItem(nsPIDOMEventTarget* aTarget, nsEventTargetChainItem::nsEventTargetChainItem(nsIDOMEventTarget* aTarget,
nsEventTargetChainItem* aChild) nsEventTargetChainItem* aChild)
: mChild(aChild), mParent(nsnull), mFlags(0), mItemFlags(0) : mChild(aChild), mParent(nsnull), mFlags(0), mItemFlags(0)
{ {
@ -298,7 +298,7 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor
{ {
PRUint32 createdELMs = nsEventListenerManager::sCreatedCount; PRUint32 createdELMs = nsEventListenerManager::sCreatedCount;
// Save the target so that it can be restored later. // Save the target so that it can be restored later.
nsCOMPtr<nsPIDOMEventTarget> firstTarget = aVisitor.mEvent->target; nsCOMPtr<nsIDOMEventTarget> firstTarget = aVisitor.mEvent->target;
// Capture // Capture
nsEventTargetChainItem* item = this; nsEventTargetChainItem* item = this;
@ -318,7 +318,7 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor
// item is at anonymous boundary. Need to retarget for the child items. // item is at anonymous boundary. Need to retarget for the child items.
nsEventTargetChainItem* nextTarget = item->mChild; nsEventTargetChainItem* nextTarget = item->mChild;
while (nextTarget) { while (nextTarget) {
nsPIDOMEventTarget* newTarget = nextTarget->GetNewTarget(); nsIDOMEventTarget* newTarget = nextTarget->GetNewTarget();
if (newTarget) { if (newTarget) {
aVisitor.mEvent->target = newTarget; aVisitor.mEvent->target = newTarget;
break; break;
@ -351,7 +351,7 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor
aVisitor.mEvent->flags &= ~NS_EVENT_FLAG_CAPTURE; aVisitor.mEvent->flags &= ~NS_EVENT_FLAG_CAPTURE;
item = item->mParent; item = item->mParent;
while (item) { while (item) {
nsPIDOMEventTarget* newTarget = item->GetNewTarget(); nsIDOMEventTarget* newTarget = item->GetNewTarget();
if (newTarget) { if (newTarget) {
// Item is at anonymous boundary. Need to retarget for the current item // Item is at anonymous boundary. Need to retarget for the current item
// and for parent items. // and for parent items.
@ -468,7 +468,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
nsIDOMEvent* aDOMEvent, nsIDOMEvent* aDOMEvent,
nsEventStatus* aEventStatus, nsEventStatus* aEventStatus,
nsDispatchingCallback* aCallback, nsDispatchingCallback* aCallback,
nsCOMArray<nsPIDOMEventTarget>* aTargets) nsCOMArray<nsIDOMEventTarget>* aTargets)
{ {
NS_ASSERTION(aEvent, "Trying to dispatch without nsEvent!"); NS_ASSERTION(aEvent, "Trying to dispatch without nsEvent!");
NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(aEvent), NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(aEvent),
@ -487,7 +487,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
timer_event_name ? timer_event_name : "<other>"); timer_event_name ? timer_event_name : "<other>");
#endif #endif
nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTarget);
PRBool retargeted = PR_FALSE; PRBool retargeted = PR_FALSE;
@ -518,14 +518,14 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
if (!nsContentUtils::IsChromeDoc(doc)) { if (!nsContentUtils::IsChromeDoc(doc)) {
nsPIDOMWindow* win = doc ? doc->GetInnerWindow() : nsnull; nsPIDOMWindow* win = doc ? doc->GetInnerWindow() : nsnull;
// If we can't dispatch the event to chrome, do nothing. // If we can't dispatch the event to chrome, do nothing.
nsPIDOMEventTarget* piTarget = win ? win->GetChromeEventHandler() : nsnull; nsIDOMEventTarget* piTarget = win ? win->GetChromeEventHandler() : nsnull;
NS_ENSURE_TRUE(piTarget, NS_OK); NS_ENSURE_TRUE(piTarget, NS_OK);
nsCOMPtr<nsIFrameLoaderOwner> flo = do_QueryInterface(piTarget); nsCOMPtr<nsIFrameLoaderOwner> flo = do_QueryInterface(piTarget);
if (flo) { if (flo) {
nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader(); nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
if (fl) { if (fl) {
nsPIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget(); nsIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
piTarget = t ? t : piTarget; piTarget = t ? t : piTarget;
} }
} }
@ -619,7 +619,7 @@ nsEventDispatcher::Dispatch(nsISupports* aTarget,
if (preVisitor.mCanHandle) { if (preVisitor.mCanHandle) {
// At least the original target can handle the event. // At least the original target can handle the event.
// Setting the retarget to the |target| simplifies retargeting code. // Setting the retarget to the |target| simplifies retargeting code.
nsCOMPtr<nsPIDOMEventTarget> t = do_QueryInterface(aEvent->target); nsCOMPtr<nsIDOMEventTarget> t = do_QueryInterface(aEvent->target);
targetEtci->SetNewTarget(t); targetEtci->SetNewTarget(t);
nsEventTargetChainItem* topEtci = targetEtci; nsEventTargetChainItem* topEtci = targetEtci;
while (preVisitor.mParentTarget) { while (preVisitor.mParentTarget) {

Просмотреть файл

@ -1092,7 +1092,7 @@ nsresult
nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct, nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct,
nsIDOMEventListener* aListener, nsIDOMEventListener* aListener,
nsIDOMEvent* aDOMEvent, nsIDOMEvent* aDOMEvent,
nsPIDOMEventTarget* aCurrentTarget, nsIDOMEventTarget* aCurrentTarget,
PRUint32 aPhaseFlags, PRUint32 aPhaseFlags,
nsCxPusher* aPusher) nsCxPusher* aPusher)
{ {
@ -1153,7 +1153,7 @@ nsresult
nsEventListenerManager::HandleEventInternal(nsPresContext* aPresContext, nsEventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
nsEvent* aEvent, nsEvent* aEvent,
nsIDOMEvent** aDOMEvent, nsIDOMEvent** aDOMEvent,
nsPIDOMEventTarget* aCurrentTarget, nsIDOMEventTarget* aCurrentTarget,
PRUint32 aFlags, PRUint32 aFlags,
nsEventStatus* aEventStatus, nsEventStatus* aEventStatus,
nsCxPusher* aPusher) nsCxPusher* aPusher)
@ -1572,7 +1572,7 @@ nsEventListenerManager::HasListeners()
nsresult nsresult
nsEventListenerManager::GetListenerInfo(nsCOMArray<nsIEventListenerInfo>* aList) nsEventListenerManager::GetListenerInfo(nsCOMArray<nsIEventListenerInfo>* aList)
{ {
nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(mTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mTarget);
NS_ENSURE_STATE(target); NS_ENSURE_STATE(target);
aList->Clear(); aList->Clear();
PRUint32 count = mListeners.Length(); PRUint32 count = mListeners.Length();

Просмотреть файл

@ -117,7 +117,7 @@ public:
nsresult HandleEvent(nsPresContext* aPresContext, nsresult HandleEvent(nsPresContext* aPresContext,
nsEvent* aEvent, nsEvent* aEvent,
nsIDOMEvent** aDOMEvent, nsIDOMEvent** aDOMEvent,
nsPIDOMEventTarget* aCurrentTarget, nsIDOMEventTarget* aCurrentTarget,
PRUint32 aFlags, PRUint32 aFlags,
nsEventStatus* aEventStatus, nsEventStatus* aEventStatus,
nsCxPusher* aPusher) nsCxPusher* aPusher)
@ -149,7 +149,7 @@ public:
nsresult HandleEventInternal(nsPresContext* aPresContext, nsresult HandleEventInternal(nsPresContext* aPresContext,
nsEvent* aEvent, nsEvent* aEvent,
nsIDOMEvent** aDOMEvent, nsIDOMEvent** aDOMEvent,
nsPIDOMEventTarget* aCurrentTarget, nsIDOMEventTarget* aCurrentTarget,
PRUint32 aFlags, PRUint32 aFlags,
nsEventStatus* aEventStatus, nsEventStatus* aEventStatus,
nsCxPusher* aPusher); nsCxPusher* aPusher);
@ -191,7 +191,7 @@ protected:
nsresult HandleEventSubType(nsListenerStruct* aListenerStruct, nsresult HandleEventSubType(nsListenerStruct* aListenerStruct,
nsIDOMEventListener* aListener, nsIDOMEventListener* aListener,
nsIDOMEvent* aDOMEvent, nsIDOMEvent* aDOMEvent,
nsPIDOMEventTarget* aCurrentTarget, nsIDOMEventTarget* aCurrentTarget,
PRUint32 aPhaseFlags, PRUint32 aPhaseFlags,
nsCxPusher* aPusher); nsCxPusher* aPusher);
nsresult CompileEventHandlerInternal(nsIScriptContext *aContext, nsresult CompileEventHandlerInternal(nsIScriptContext *aContext,

Просмотреть файл

@ -37,7 +37,7 @@
#include "nsEventListenerService.h" #include "nsEventListenerService.h"
#include "nsCOMArray.h" #include "nsCOMArray.h"
#include "nsEventListenerManager.h" #include "nsEventListenerManager.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIVariant.h" #include "nsIVariant.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsMemory.h" #include "nsMemory.h"
@ -202,7 +202,7 @@ nsEventListenerService::GetListenerInfoFor(nsIDOMEventTarget* aEventTarget,
*aCount = 0; *aCount = 0;
*aOutArray = nsnull; *aOutArray = nsnull;
nsCOMArray<nsIEventListenerInfo> listenerInfos; nsCOMArray<nsIEventListenerInfo> listenerInfos;
nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aEventTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aEventTarget);
if (target) { if (target) {
nsCOMPtr<nsIEventListenerManager> elm = nsCOMPtr<nsIEventListenerManager> elm =
target->GetListenerManager(PR_FALSE); target->GetListenerManager(PR_FALSE);
@ -235,10 +235,10 @@ nsEventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
{ {
*aCount = 0; *aCount = 0;
*aOutArray = nsnull; *aOutArray = nsnull;
nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aEventTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aEventTarget);
NS_ENSURE_ARG(target); NS_ENSURE_ARG(target);
nsEvent event(PR_TRUE, NS_EVENT_TYPE_NULL); nsEvent event(PR_TRUE, NS_EVENT_TYPE_NULL);
nsCOMArray<nsPIDOMEventTarget> targets; nsCOMArray<nsIDOMEventTarget> targets;
nsresult rv = nsEventDispatcher::Dispatch(target, nsnull, &event, nsresult rv = nsEventDispatcher::Dispatch(target, nsnull, &event,
nsnull, nsnull, nsnull, &targets); nsnull, nsnull, nsnull, &targets);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -249,7 +249,7 @@ nsEventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
*aOutArray = *aOutArray =
static_cast<nsIDOMEventTarget**>( static_cast<nsIDOMEventTarget**>(
nsMemory::Alloc(sizeof(nsPIDOMEventTarget*) * count)); nsMemory::Alloc(sizeof(nsIDOMEventTarget*) * count));
NS_ENSURE_TRUE(*aOutArray, NS_ERROR_OUT_OF_MEMORY); NS_ENSURE_TRUE(*aOutArray, NS_ERROR_OUT_OF_MEMORY);
for (PRInt32 i = 0; i < count; ++i) { for (PRInt32 i = 0; i < count; ++i) {

Просмотреть файл

@ -42,7 +42,7 @@
#include "nsIDOMEventListener.h" #include "nsIDOMEventListener.h"
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsString.h" #include "nsString.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "jsapi.h" #include "jsapi.h"

Просмотреть файл

@ -1147,7 +1147,7 @@ nsGenericHTMLElement::GetEventListenerManagerForAttr(nsIEventListenerManager** a
// bail if it does. // bail if it does.
if (document && if (document &&
(win = document->GetInnerWindow()) && win->IsInnerWindow()) { (win = document->GetInnerWindow()) && win->IsInnerWindow()) {
nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(win)); nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(win));
NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE); NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
*aManager = piTarget->GetListenerManager(PR_TRUE); *aManager = piTarget->GetListenerManager(PR_TRUE);

Просмотреть файл

@ -377,7 +377,7 @@ nsSMILTimeValueSpec::GetEventListenerManager(Element* aTarget,
NS_ABORT_IF_FALSE(aSystemGroup && !*aSystemGroup, NS_ABORT_IF_FALSE(aSystemGroup && !*aSystemGroup,
"Bad out param for system group"); "Bad out param for system group");
nsCOMPtr<nsPIDOMEventTarget> piTarget; nsCOMPtr<nsIDOMEventTarget> piTarget;
if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) { if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
nsIDocument* doc = aTarget->GetCurrentDoc(); nsIDocument* doc = aTarget->GetCurrentDoc();

Просмотреть файл

@ -83,7 +83,7 @@ nsXBLEventHandler::HandleEvent(nsIDOMEvent* aEvent)
nsCOMPtr<nsIDOMEventTarget> target; nsCOMPtr<nsIDOMEventTarget> target;
aEvent->GetCurrentTarget(getter_AddRefs(target)); aEvent->GetCurrentTarget(getter_AddRefs(target));
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(target); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(target);
mProtoHandler->ExecuteHandler(piTarget, aEvent); mProtoHandler->ExecuteHandler(piTarget, aEvent);
@ -133,7 +133,7 @@ nsXBLKeyEventHandler::ExecuteMatchedHandlers(nsIDOMKeyEvent* aKeyEvent,
nsCOMPtr<nsIDOMEventTarget> target; nsCOMPtr<nsIDOMEventTarget> target;
aKeyEvent->GetCurrentTarget(getter_AddRefs(target)); aKeyEvent->GetCurrentTarget(getter_AddRefs(target));
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(target); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(target);
PRBool executed = PR_FALSE; PRBool executed = PR_FALSE;
for (PRUint32 i = 0; i < mProtoHandlers.Length(); ++i) { for (PRUint32 i = 0; i < mProtoHandlers.Length(); ++i) {

Просмотреть файл

@ -214,7 +214,7 @@ nsXBLPrototypeHandler::InitAccessKeys()
} }
nsresult nsresult
nsXBLPrototypeHandler::ExecuteHandler(nsPIDOMEventTarget* aTarget, nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventTarget* aTarget,
nsIDOMEvent* aEvent) nsIDOMEvent* aEvent)
{ {
nsresult rv = NS_ERROR_FAILURE; nsresult rv = NS_ERROR_FAILURE;
@ -379,7 +379,7 @@ nsXBLPrototypeHandler::EnsureEventHandler(nsIScriptGlobalObject* aGlobal,
} }
nsresult nsresult
nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEvent* aEvent) nsXBLPrototypeHandler::DispatchXBLCommand(nsIDOMEventTarget* aTarget, nsIDOMEvent* aEvent)
{ {
// This is a special-case optimization to make command handling fast. // This is a special-case optimization to make command handling fast.
// It isn't really a part of XBL, but it helps speed things up. // It isn't really a part of XBL, but it helps speed things up.
@ -547,7 +547,7 @@ nsXBLPrototypeHandler::GetEventName()
} }
already_AddRefed<nsIController> already_AddRefed<nsIController>
nsXBLPrototypeHandler::GetController(nsPIDOMEventTarget* aTarget) nsXBLPrototypeHandler::GetController(nsIDOMEventTarget* aTarget)
{ {
// XXX Fix this so there's a generic interface that describes controllers, // XXX Fix this so there's a generic interface that describes controllers,
// This code should have no special knowledge of what objects might have controllers. // This code should have no special knowledge of what objects might have controllers.

Просмотреть файл

@ -709,11 +709,11 @@ nsXBLService::ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID,
// then extra work needs to be done to hook it up to the document (XXX WHY??) // then extra work needs to be done to hook it up to the document (XXX WHY??)
// //
NS_IMETHODIMP NS_IMETHODIMP
nsXBLService::AttachGlobalKeyHandler(nsPIDOMEventTarget* aTarget) nsXBLService::AttachGlobalKeyHandler(nsIDOMEventTarget* aTarget)
{ {
// check if the receiver is a content node (not a document), and hook // check if the receiver is a content node (not a document), and hook
// it to the document if that is the case. // it to the document if that is the case.
nsCOMPtr<nsPIDOMEventTarget> piTarget = aTarget; nsCOMPtr<nsIDOMEventTarget> piTarget = aTarget;
nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget)); nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget));
if (contentNode) { if (contentNode) {
// Only attach if we're really in a document // Only attach if we're really in a document
@ -765,9 +765,9 @@ nsXBLService::AttachGlobalKeyHandler(nsPIDOMEventTarget* aTarget)
// Removes a key handler added by DeatchGlobalKeyHandler. // Removes a key handler added by DeatchGlobalKeyHandler.
// //
NS_IMETHODIMP NS_IMETHODIMP
nsXBLService::DetachGlobalKeyHandler(nsPIDOMEventTarget* aTarget) nsXBLService::DetachGlobalKeyHandler(nsIDOMEventTarget* aTarget)
{ {
nsCOMPtr<nsPIDOMEventTarget> piTarget = aTarget; nsCOMPtr<nsIDOMEventTarget> piTarget = aTarget;
nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget)); nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget));
if (!contentNode) // detaching is only supported for content nodes if (!contentNode) // detaching is only supported for content nodes
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;

Просмотреть файл

@ -179,7 +179,7 @@ nsXBLSpecialDocInfo* nsXBLWindowKeyHandler::sXBLSpecialDocInfo = nsnull;
PRUint32 nsXBLWindowKeyHandler::sRefCnt = 0; PRUint32 nsXBLWindowKeyHandler::sRefCnt = 0;
nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(nsIDOMElement* aElement, nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(nsIDOMElement* aElement,
nsPIDOMEventTarget* aTarget) nsIDOMEventTarget* aTarget)
: mTarget(aTarget), : mTarget(aTarget),
mHandler(nsnull), mHandler(nsnull),
mUserHandler(nsnull) mUserHandler(nsnull)
@ -566,7 +566,7 @@ nsXBLWindowKeyHandler::WalkHandlersAndExecute(nsIDOMKeyEvent* aKeyEvent,
} }
} }
nsCOMPtr<nsPIDOMEventTarget> piTarget; nsCOMPtr<nsIDOMEventTarget> piTarget;
nsCOMPtr<nsIDOMElement> element = GetElement(); nsCOMPtr<nsIDOMElement> element = GetElement();
if (element) { if (element) {
piTarget = do_QueryInterface(commandElt); piTarget = do_QueryInterface(commandElt);
@ -595,7 +595,7 @@ nsXBLWindowKeyHandler::GetElement()
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
nsresult nsresult
NS_NewXBLWindowKeyHandler(nsIDOMElement* aElement, nsPIDOMEventTarget* aTarget, NS_NewXBLWindowKeyHandler(nsIDOMElement* aElement, nsIDOMEventTarget* aTarget,
nsXBLWindowKeyHandler** aResult) nsXBLWindowKeyHandler** aResult)
{ {
*aResult = new nsXBLWindowKeyHandler(aElement, aTarget); *aResult = new nsXBLWindowKeyHandler(aElement, aTarget);

Просмотреть файл

@ -533,7 +533,7 @@ nsXULElement::GetEventListenerManagerForAttr(nsIEventListenerManager** aManager,
if ((!root || root == this) && !mNodeInfo->Equals(nsGkAtoms::overlay) && if ((!root || root == this) && !mNodeInfo->Equals(nsGkAtoms::overlay) &&
(window = doc->GetInnerWindow()) && window->IsInnerWindow()) { (window = doc->GetInnerWindow()) && window->IsInnerWindow()) {
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(window); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(window);
if (!piTarget) if (!piTarget)
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
@ -2192,7 +2192,7 @@ PopupListenerPropertyDtor(void* aObject, nsIAtom* aPropertyName,
do_QueryInterface(static_cast<nsINode*>(aObject)); do_QueryInterface(static_cast<nsINode*>(aObject));
if (target) { if (target) {
nsCOMPtr<nsIDOMEventGroup> systemGroup; nsCOMPtr<nsIDOMEventGroup> systemGroup;
static_cast<nsPIDOMEventTarget*>(aObject)-> static_cast<nsIDOMEventTarget*>(aObject)->
GetSystemEventGroup(getter_AddRefs(systemGroup)); GetSystemEventGroup(getter_AddRefs(systemGroup));
if (systemGroup) { if (systemGroup) {
target->RemoveGroupedEventListener(NS_LITERAL_STRING("mousedown"), target->RemoveGroupedEventListener(NS_LITERAL_STRING("mousedown"),

Просмотреть файл

@ -1717,7 +1717,7 @@ nsXULDocument::AddElementToDocumentPost(Element* aElement)
// Create our XUL key listener and hook it up. // Create our XUL key listener and hook it up.
nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1")); nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1"));
if (xblService) { if (xblService) {
nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(aElement)); nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(aElement));
xblService->AttachGlobalKeyHandler(piTarget); xblService->AttachGlobalKeyHandler(piTarget);
} }
} }
@ -1793,7 +1793,7 @@ nsXULDocument::RemoveSubtreeFromDocument(nsIContent* aContent)
if (aElement->NodeInfo()->Equals(nsGkAtoms::keyset, kNameSpaceID_XUL)) { if (aElement->NodeInfo()->Equals(nsGkAtoms::keyset, kNameSpaceID_XUL)) {
nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1")); nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1"));
if (xblService) { if (xblService) {
nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(aElement)); nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(aElement));
xblService->DetachGlobalKeyHandler(piTarget); xblService->DetachGlobalKeyHandler(piTarget);
} }
} }

Просмотреть файл

@ -1773,7 +1773,7 @@ nsDocShell::GetContentViewer(nsIContentViewer ** aContentViewer)
NS_IMETHODIMP NS_IMETHODIMP
nsDocShell::SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler) nsDocShell::SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler)
{ {
nsCOMPtr<nsPIDOMEventTarget> piTarget = nsCOMPtr<nsIDOMEventTarget> piTarget =
do_QueryInterface(aChromeEventHandler); do_QueryInterface(aChromeEventHandler);
// Weak reference. Don't addref. // Weak reference. Don't addref.
mChromeEventHandler = piTarget; mChromeEventHandler = piTarget;

Просмотреть файл

@ -106,7 +106,7 @@
#include "nsISecureBrowserUI.h" #include "nsISecureBrowserUI.h"
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsDocShellLoadTypes.h" #include "nsDocShellLoadTypes.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsILoadContext.h" #include "nsILoadContext.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIWebShellServices.h" #include "nsIWebShellServices.h"
@ -768,7 +768,7 @@ protected:
// For that reasons don't use nsCOMPtr. // For that reasons don't use nsCOMPtr.
nsIDocShellTreeOwner * mTreeOwner; // Weak Reference nsIDocShellTreeOwner * mTreeOwner; // Weak Reference
nsPIDOMEventTarget * mChromeEventHandler; //Weak Reference nsIDOMEventTarget * mChromeEventHandler; //Weak Reference
eCharsetReloadState mCharsetReloadState; eCharsetReloadState mCharsetReloadState;

Просмотреть файл

@ -7749,11 +7749,11 @@ nsEventReceiverSH::RegisterCompileHandler(nsIXPConnectWrappedNative *wrapper,
nsIScriptContext *script_cx = nsJSUtils::GetStaticScriptContext(cx, obj); nsIScriptContext *script_cx = nsJSUtils::GetStaticScriptContext(cx, obj);
NS_ENSURE_TRUE(script_cx, NS_ERROR_UNEXPECTED); NS_ENSURE_TRUE(script_cx, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsPIDOMEventTarget> piTarget = nsCOMPtr<nsIDOMEventTarget> piTarget =
do_QueryWrappedNative(wrapper, obj); do_QueryWrappedNative(wrapper, obj);
if (!piTarget) { if (!piTarget) {
// Doesn't do events // Doesn't do events
NS_WARNING("Doesn't QI to nsPIDOMEventTarget?"); NS_WARNING("Doesn't QI to nsIDOMEventTarget?");
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -108,7 +108,7 @@ struct nsDelayedBlurOrFocusEvent
nsDelayedBlurOrFocusEvent(PRUint32 aType, nsDelayedBlurOrFocusEvent(PRUint32 aType,
nsIPresShell* aPresShell, nsIPresShell* aPresShell,
nsIDocument* aDocument, nsIDocument* aDocument,
nsPIDOMEventTarget* aTarget) nsIDOMEventTarget* aTarget)
: mType(aType), : mType(aType),
mPresShell(aPresShell), mPresShell(aPresShell),
mDocument(aDocument), mDocument(aDocument),
@ -123,7 +123,7 @@ struct nsDelayedBlurOrFocusEvent
PRUint32 mType; PRUint32 mType;
nsCOMPtr<nsIPresShell> mPresShell; nsCOMPtr<nsIPresShell> mPresShell;
nsCOMPtr<nsIDocument> mDocument; nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsPIDOMEventTarget> mTarget; nsCOMPtr<nsIDOMEventTarget> mTarget;
}; };
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFocusManager) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFocusManager)
@ -1008,7 +1008,7 @@ nsFocusManager::FireDelayedEvents(nsIDocument* aDocument)
if (mDelayedBlurFocusEvents[i].mDocument == aDocument && if (mDelayedBlurFocusEvents[i].mDocument == aDocument &&
!aDocument->EventHandlingSuppressed()) { !aDocument->EventHandlingSuppressed()) {
PRUint32 type = mDelayedBlurFocusEvents[i].mType; PRUint32 type = mDelayedBlurFocusEvents[i].mType;
nsCOMPtr<nsPIDOMEventTarget> target = mDelayedBlurFocusEvents[i].mTarget; nsCOMPtr<nsIDOMEventTarget> target = mDelayedBlurFocusEvents[i].mTarget;
nsCOMPtr<nsIPresShell> presShell = mDelayedBlurFocusEvents[i].mPresShell; nsCOMPtr<nsIPresShell> presShell = mDelayedBlurFocusEvents[i].mPresShell;
mDelayedBlurFocusEvents.RemoveElementAt(i); mDelayedBlurFocusEvents.RemoveElementAt(i);
SendFocusOrBlurEvent(type, presShell, aDocument, target, 0, PR_FALSE); SendFocusOrBlurEvent(type, presShell, aDocument, target, 0, PR_FALSE);
@ -1851,7 +1851,7 @@ nsFocusManager::SendFocusOrBlurEvent(PRUint32 aType,
NS_ASSERTION(aType == NS_FOCUS_CONTENT || aType == NS_BLUR_CONTENT, NS_ASSERTION(aType == NS_FOCUS_CONTENT || aType == NS_BLUR_CONTENT,
"Wrong event type for SendFocusOrBlurEvent"); "Wrong event type for SendFocusOrBlurEvent");
nsCOMPtr<nsPIDOMEventTarget> eventTarget = do_QueryInterface(aTarget); nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(aTarget);
// for focus events, if this event was from a mouse or key and event // for focus events, if this event was from a mouse or key and event
// handling on the document is suppressed, queue the event and fire it // handling on the document is suppressed, queue the event and fire it

Просмотреть файл

@ -1851,7 +1851,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument,
if (internal == static_cast<nsIDOMWindowInternal *>(this)) { if (internal == static_cast<nsIDOMWindowInternal *>(this)) {
nsCOMPtr<nsIXBLService> xblService = do_GetService("@mozilla.org/xbl;1"); nsCOMPtr<nsIXBLService> xblService = do_GetService("@mozilla.org/xbl;1");
if (xblService) { if (xblService) {
nsCOMPtr<nsPIDOMEventTarget> piTarget = nsCOMPtr<nsIDOMEventTarget> piTarget =
do_QueryInterface(mChromeEventHandler); do_QueryInterface(mChromeEventHandler);
xblService->AttachGlobalKeyHandler(piTarget); xblService->AttachGlobalKeyHandler(piTarget);
} }
@ -2517,17 +2517,17 @@ nsGlobalWindow::GetIsTabModalPromptAllowed()
return allowTabModal; return allowTabModal;
} }
nsPIDOMEventTarget* nsIDOMEventTarget*
nsGlobalWindow::GetTargetForDOMEvent() nsGlobalWindow::GetTargetForDOMEvent()
{ {
return static_cast<nsPIDOMEventTarget*>(GetOuterWindowInternal()); return static_cast<nsIDOMEventTarget*>(GetOuterWindowInternal());
} }
nsPIDOMEventTarget* nsIDOMEventTarget*
nsGlobalWindow::GetTargetForEventTargetChain() nsGlobalWindow::GetTargetForEventTargetChain()
{ {
return IsInnerWindow() ? return IsInnerWindow() ?
this : static_cast<nsPIDOMEventTarget*>(GetCurrentInnerWindowInternal()); this : static_cast<nsIDOMEventTarget*>(GetCurrentInnerWindowInternal());
} }
nsresult nsresult
@ -2707,7 +2707,7 @@ nsGlobalWindow::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
/* mChromeEventHandler and mContext go dangling in the middle of this /* mChromeEventHandler and mContext go dangling in the middle of this
function under some circumstances (events that destroy the window) function under some circumstances (events that destroy the window)
without this addref. */ without this addref. */
nsCOMPtr<nsPIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler); nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal()); nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal());
if (aVisitor.mEvent->message == NS_RESIZE_EVENT) { if (aVisitor.mEvent->message == NS_RESIZE_EVENT) {
@ -7365,7 +7365,7 @@ nsGlobalWindow::GetListenerManager(PRBool aCreateIfNotFound)
mListenerManager = do_CreateInstance(kEventListenerManagerCID); mListenerManager = do_CreateInstance(kEventListenerManagerCID);
if (mListenerManager) { if (mListenerManager) {
mListenerManager->SetListenerTarget( mListenerManager->SetListenerTarget(
static_cast<nsPIDOMEventTarget*>(this)); static_cast<nsIDOMEventTarget*>(this));
} }
} }
@ -7587,7 +7587,7 @@ nsGlobalWindow::DisableDeviceMotionUpdates()
} }
void void
nsGlobalWindow::SetChromeEventHandler(nsPIDOMEventTarget* aChromeEventHandler) nsGlobalWindow::SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler)
{ {
SetChromeEventHandlerInternal(aChromeEventHandler); SetChromeEventHandlerInternal(aChromeEventHandler);
if (IsOuterWindow()) { if (IsOuterWindow()) {

Просмотреть файл

@ -102,7 +102,7 @@
#include "nsIDOMStorageEvent.h" #include "nsIDOMStorageEvent.h"
#include "nsIDOMStorageIndexedDB.h" #include "nsIDOMStorageIndexedDB.h"
#include "nsIDOMOfflineResourceList.h" #include "nsIDOMOfflineResourceList.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIArray.h" #include "nsIArray.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIIDBFactory.h" #include "nsIIDBFactory.h"
@ -347,7 +347,7 @@ public:
virtual NS_HIDDEN_(nsPIDOMWindow*) GetPrivateRoot(); virtual NS_HIDDEN_(nsPIDOMWindow*) GetPrivateRoot();
virtual NS_HIDDEN_(void) ActivateOrDeactivate(PRBool aActivate); virtual NS_HIDDEN_(void) ActivateOrDeactivate(PRBool aActivate);
virtual NS_HIDDEN_(void) SetActive(PRBool aActive); virtual NS_HIDDEN_(void) SetActive(PRBool aActive);
virtual NS_HIDDEN_(void) SetChromeEventHandler(nsPIDOMEventTarget* aChromeEventHandler); virtual NS_HIDDEN_(void) SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler);
virtual NS_HIDDEN_(void) SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal); virtual NS_HIDDEN_(void) SetOpenerScriptPrincipal(nsIPrincipal* aPrincipal);
virtual NS_HIDDEN_(nsIPrincipal*) GetOpenerScriptPrincipal(); virtual NS_HIDDEN_(nsIPrincipal*) GetOpenerScriptPrincipal();

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIDOMXULCommandDispatcher.h" #include "nsIDOMXULCommandDispatcher.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowInternal.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsEvent.h" #include "nsEvent.h"
@ -115,14 +115,14 @@ public:
return mIsBackground; return mIsBackground;
} }
nsPIDOMEventTarget* GetChromeEventHandler() const nsIDOMEventTarget* GetChromeEventHandler() const
{ {
return mChromeEventHandler; return mChromeEventHandler;
} }
virtual void SetChromeEventHandler(nsPIDOMEventTarget* aChromeEventHandler) = 0; virtual void SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler) = 0;
nsPIDOMEventTarget* GetParentTarget() nsIDOMEventTarget* GetParentTarget()
{ {
if (!mParentTarget) { if (!mParentTarget) {
UpdateParentTarget(); UpdateParentTarget();
@ -588,7 +588,7 @@ protected:
~nsPIDOMWindow(); ~nsPIDOMWindow();
void SetChromeEventHandlerInternal(nsPIDOMEventTarget* aChromeEventHandler) { void SetChromeEventHandlerInternal(nsIDOMEventTarget* aChromeEventHandler) {
mChromeEventHandler = aChromeEventHandler; mChromeEventHandler = aChromeEventHandler;
// mParentTarget will be set when the next event is dispatched. // mParentTarget will be set when the next event is dispatched.
mParentTarget = nsnull; mParentTarget = nsnull;
@ -599,10 +599,10 @@ protected:
// These two variables are special in that they're set to the same // These two variables are special in that they're set to the same
// value on both the outer window and the current inner window. Make // value on both the outer window and the current inner window. Make
// sure you keep them in sync! // sure you keep them in sync!
nsCOMPtr<nsPIDOMEventTarget> mChromeEventHandler; // strong nsCOMPtr<nsIDOMEventTarget> mChromeEventHandler; // strong
nsCOMPtr<nsIDOMDocument> mDocument; // strong nsCOMPtr<nsIDOMDocument> mDocument; // strong
nsCOMPtr<nsPIDOMEventTarget> mParentTarget; // strong nsCOMPtr<nsIDOMEventTarget> mParentTarget; // strong
// These members are only used on outer windows. // These members are only used on outer windows.
nsCOMPtr<nsIDOMElement> mFrameElement; nsCOMPtr<nsIDOMElement> mFrameElement;

Просмотреть файл

@ -41,7 +41,7 @@
#define nsPIWindowRoot_h__ #define nsPIWindowRoot_h__
#include "nsISupports.h" #include "nsISupports.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
class nsPIDOMWindow; class nsPIDOMWindow;
class nsIControllers; class nsIControllers;
@ -68,8 +68,8 @@ public:
nsIController** aResult) = 0; nsIController** aResult) = 0;
virtual nsresult GetControllers(nsIControllers** aResult) = 0; virtual nsresult GetControllers(nsIControllers** aResult) = 0;
virtual void SetParentTarget(nsPIDOMEventTarget* aTarget) = 0; virtual void SetParentTarget(nsIDOMEventTarget* aTarget) = 0;
virtual nsPIDOMEventTarget* GetParentTarget() = 0; virtual nsIDOMEventTarget* GetParentTarget() = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID) NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID)

Просмотреть файл

@ -105,7 +105,7 @@ nsWindowRoot::DispatchEvent(nsIDOMEvent* aEvt, PRBool *aRetVal)
{ {
nsEventStatus status = nsEventStatus_eIgnore; nsEventStatus status = nsEventStatus_eIgnore;
nsresult rv = nsEventDispatcher::DispatchDOMEvent( nsresult rv = nsEventDispatcher::DispatchDOMEvent(
static_cast<nsPIDOMEventTarget*>(this), nsnull, aEvt, nsnull, &status); static_cast<nsIDOMEventTarget*>(this), nsnull, aEvt, nsnull, &status);
*aRetVal = (status != nsEventStatus_eConsumeNoDefault); *aRetVal = (status != nsEventStatus_eConsumeNoDefault);
return rv; return rv;
} }
@ -116,7 +116,7 @@ nsWindowRoot::DispatchDOMEvent(nsEvent* aEvent,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsEventStatus* aEventStatus) nsEventStatus* aEventStatus)
{ {
return nsEventDispatcher::DispatchDOMEvent(static_cast<nsPIDOMEventTarget*>(this), return nsEventDispatcher::DispatchDOMEvent(static_cast<nsIDOMEventTarget*>(this),
aEvent, aDOMEvent, aEvent, aDOMEvent,
aPresContext, aEventStatus); aPresContext, aEventStatus);
} }
@ -208,7 +208,7 @@ nsWindowRoot::GetListenerManager(PRBool aCreateIfNotFound)
mListenerManager = do_CreateInstance(kEventListenerManagerCID); mListenerManager = do_CreateInstance(kEventListenerManagerCID);
if (mListenerManager) { if (mListenerManager) {
mListenerManager->SetListenerTarget( mListenerManager->SetListenerTarget(
static_cast<nsPIDOMEventTarget*>(this)); static_cast<nsIDOMEventTarget*>(this));
} }
} }
@ -355,7 +355,7 @@ nsWindowRoot::SetPopupNode(nsIDOMNode* aNode)
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
nsresult nsresult
NS_NewWindowRoot(nsPIDOMWindow* aWindow, nsPIDOMEventTarget** aResult) NS_NewWindowRoot(nsPIDOMWindow* aWindow, nsIDOMEventTarget** aResult)
{ {
*aResult = new nsWindowRoot(aWindow); *aResult = new nsWindowRoot(aWindow);
if (!*aResult) if (!*aResult)

Просмотреть файл

@ -76,11 +76,11 @@ public:
virtual nsIDOMNode* GetPopupNode(); virtual nsIDOMNode* GetPopupNode();
virtual void SetPopupNode(nsIDOMNode* aNode); virtual void SetPopupNode(nsIDOMNode* aNode);
virtual void SetParentTarget(nsPIDOMEventTarget* aTarget) virtual void SetParentTarget(nsIDOMEventTarget* aTarget)
{ {
mParent = aTarget; mParent = aTarget;
} }
virtual nsPIDOMEventTarget* GetParentTarget() { return mParent; } virtual nsIDOMEventTarget* GetParentTarget() { return mParent; }
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget) NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget)
@ -92,11 +92,11 @@ protected:
nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER] nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
nsCOMPtr<nsPIDOMEventTarget> mParent; nsCOMPtr<nsIDOMEventTarget> mParent;
}; };
extern nsresult extern nsresult
NS_NewWindowRoot(nsPIDOMWindow* aWindow, NS_NewWindowRoot(nsPIDOMWindow* aWindow,
nsPIDOMEventTarget** aResult); nsIDOMEventTarget** aResult);
#endif #endif

Просмотреть файл

@ -301,9 +301,9 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBCursor)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBCursor) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBCursor)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRequest, NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRequest,
nsPIDOMEventTarget) nsIDOMEventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTransaction, NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTransaction,
nsPIDOMEventTarget) nsIDOMEventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mObjectStore) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIndex) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIndex)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner)

Просмотреть файл

@ -712,7 +712,7 @@ IDBDatabase::SetVersion(const nsAString& aVersion,
NS_ENSURE_TRUE(transaction, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR); NS_ENSURE_TRUE(transaction, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
nsRefPtr<IDBVersionChangeRequest> request = nsRefPtr<IDBVersionChangeRequest> request =
IDBVersionChangeRequest::Create(static_cast<nsPIDOMEventTarget*>(this), IDBVersionChangeRequest::Create(static_cast<nsIDOMEventTarget*>(this),
ScriptContext(), Owner(), transaction); ScriptContext(), Owner(), transaction);
NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR); NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
@ -966,7 +966,7 @@ SetVersionHelper::GetSuccessResult(JSContext* aCx,
} }
info->version = mVersion; info->version = mVersion;
nsresult rv = WrapNative(aCx, NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, nsresult rv = WrapNative(aCx, NS_ISUPPORTS_CAST(nsIDOMEventTarget*,
mTransaction), mTransaction),
aVal); aVal);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -80,7 +80,7 @@ public:
DatabaseInfo* aDatabaseInfo, DatabaseInfo* aDatabaseInfo,
const nsACString& aASCIIOrigin); const nsACString& aASCIIOrigin);
// nsPIDOMEventTarget // nsIDOMEventTarget
virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor); virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
PRUint32 Id() PRUint32 Id()

Просмотреть файл

@ -1080,6 +1080,6 @@ OpenDatabaseHelper::GetSuccessResult(JSContext* aCx,
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
} }
return WrapNative(aCx, NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, database), return WrapNative(aCx, NS_ISUPPORTS_CAST(nsIDOMEventTarget*, database),
aVal); aVal);
} }

Просмотреть файл

@ -991,7 +991,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBObjectStore) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTransaction, NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTransaction,
nsPIDOMEventTarget) nsIDOMEventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mScriptContext) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mScriptContext)

Просмотреть файл

@ -72,7 +72,7 @@ public:
nsPIDOMWindow* aOwner, nsPIDOMWindow* aOwner,
IDBTransaction* aTransaction); IDBTransaction* aTransaction);
// nsPIDOMEventTarget // nsIDOMEventTarget
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor); virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
nsISupports* Source() nsISupports* Source()

Просмотреть файл

@ -628,7 +628,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBTransaction)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBTransaction, NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBTransaction,
nsDOMEventTargetHelper) nsDOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mDatabase, NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mDatabase,
nsPIDOMEventTarget) nsIDOMEventTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnErrorListener) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnErrorListener)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnCompleteListener) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnCompleteListener)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnAbortListener) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnAbortListener)

Просмотреть файл

@ -89,7 +89,7 @@ public:
PRUint32 aTimeout, PRUint32 aTimeout,
bool aDispatchDelayed = false); bool aDispatchDelayed = false);
// nsPIDOMEventTarget // nsIDOMEventTarget
virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor); virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
void OnNewRequest(); void OnNewRequest();

Просмотреть файл

@ -758,7 +758,7 @@ TabChild::RecvAsyncMessage(const nsString& aMessage,
nsFrameScriptCx cx(static_cast<nsIWebBrowserChrome*>(this), this); nsFrameScriptCx cx(static_cast<nsIWebBrowserChrome*>(this), this);
nsRefPtr<nsFrameMessageManager> mm = nsRefPtr<nsFrameMessageManager> mm =
static_cast<nsFrameMessageManager*>(mTabChildGlobal->mMessageManager.get()); static_cast<nsFrameMessageManager*>(mTabChildGlobal->mMessageManager.get());
mm->ReceiveMessage(static_cast<nsPIDOMEventTarget*>(mTabChildGlobal), mm->ReceiveMessage(static_cast<nsIDOMEventTarget*>(mTabChildGlobal),
aMessage, PR_FALSE, aJSON, nsnull, nsnull); aMessage, PR_FALSE, aJSON, nsnull, nsnull);
} }
return true; return true;
@ -866,7 +866,7 @@ TabChild::InitTabChildGlobal()
mTabChildGlobal = scope; mTabChildGlobal = scope;
nsISupports* scopeSupports = nsISupports* scopeSupports =
NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, scope); NS_ISUPPORTS_CAST(nsIDOMEventTarget*, scope);
JS_SetContextPrivate(cx, scopeSupports); JS_SetContextPrivate(cx, scopeSupports);
nsresult rv = nsresult rv =

Просмотреть файл

@ -52,7 +52,7 @@
#include "nsVariant.h" #include "nsVariant.h"
#include "nsIDOMBeforeUnloadEvent.h" #include "nsIDOMBeforeUnloadEvent.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIJSContextStack.h" #include "nsIJSContextStack.h"
#ifdef NS_DEBUG #ifdef NS_DEBUG
#include "nsDOMJSUtils.h" #include "nsDOMJSUtils.h"
@ -132,7 +132,7 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsJSEventListener)
nsresult nsresult
nsJSEventListener::GetJSVal(const nsAString& aEventName, jsval* aJSVal) nsJSEventListener::GetJSVal(const nsAString& aEventName, jsval* aJSVal)
{ {
nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(mTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mTarget);
if (target && mContext) { if (target && mContext) {
nsAutoString eventString = NS_LITERAL_STRING("on") + aEventName; nsAutoString eventString = NS_LITERAL_STRING("on") + aEventName;
nsCOMPtr<nsIAtom> atomName = do_GetAtom(eventString); nsCOMPtr<nsIAtom> atomName = do_GetAtom(eventString);

Просмотреть файл

@ -45,7 +45,7 @@
#include "nsIDOMNSHTMLElement.h" #include "nsIDOMNSHTMLElement.h"
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMNSEvent.h" #include "nsIDOMNSEvent.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIMEStateManager.h" #include "nsIMEStateManager.h"
#include "nsFocusManager.h" #include "nsFocusManager.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
@ -5237,7 +5237,7 @@ nsEditor::GetNativeKeyEvent(nsIDOMKeyEvent* aDOMKeyEvent)
already_AddRefed<nsIContent> already_AddRefed<nsIContent>
nsEditor::GetFocusedContent() nsEditor::GetFocusedContent()
{ {
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
if (!piTarget) { if (!piTarget) {
return nsnull; return nsnull;
} }
@ -5252,7 +5252,7 @@ nsEditor::GetFocusedContent()
PRBool PRBool
nsEditor::IsActiveInDOMWindow() nsEditor::IsActiveInDOMWindow()
{ {
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
if (!piTarget) { if (!piTarget) {
return PR_FALSE; return PR_FALSE;
} }

Просмотреть файл

@ -62,7 +62,7 @@
#include "nsSelectionState.h" #include "nsSelectionState.h"
#include "nsIEditorSpellCheck.h" #include "nsIEditorSpellCheck.h"
#include "nsIInlineSpellChecker.h" #include "nsIInlineSpellChecker.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsStubMutationObserver.h" #include "nsStubMutationObserver.h"
#include "nsIViewManager.h" #include "nsIViewManager.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
@ -613,7 +613,7 @@ public:
nsIDOMNode *aEndNode, nsIDOMNode *aEndNode,
PRInt32 aEndOffset); PRInt32 aEndOffset);
virtual already_AddRefed<nsPIDOMEventTarget> GetPIDOMEventTarget() = 0; virtual already_AddRefed<nsIDOMEventTarget> GetPIDOMEventTarget() = 0;
// Fast non-refcounting editor root element accessor // Fast non-refcounting editor root element accessor
nsIDOMElement *GetRoot(); nsIDOMElement *GetRoot();
@ -764,7 +764,7 @@ protected:
PRInt8 mDocDirtyState; // -1 = not initialized PRInt8 mDocDirtyState; // -1 = not initialized
nsWeakPtr mDocWeak; // weak reference to the nsIDOMDocument nsWeakPtr mDocWeak; // weak reference to the nsIDOMDocument
// The form field as an event receiver // The form field as an event receiver
nsCOMPtr<nsPIDOMEventTarget> mEventTarget; nsCOMPtr<nsIDOMEventTarget> mEventTarget;
nsString* mPhonetic; nsString* mPhonetic;

Просмотреть файл

@ -44,7 +44,7 @@
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
#include "nsIDOMNSEvent.h" #include "nsIDOMNSEvent.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsISelection.h" #include "nsISelection.h"
@ -125,7 +125,7 @@ nsEditorEventListener::InstallToEditor()
{ {
NS_PRECONDITION(mEditor, "The caller must set mEditor"); NS_PRECONDITION(mEditor, "The caller must set mEditor");
nsCOMPtr<nsPIDOMEventTarget> piTarget = mEditor->GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = mEditor->GetPIDOMEventTarget();
NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE); NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
nsresult rv; nsresult rv;
@ -204,7 +204,7 @@ nsEditorEventListener::Disconnect()
void void
nsEditorEventListener::UninstallFromEditor() nsEditorEventListener::UninstallFromEditor()
{ {
nsCOMPtr<nsPIDOMEventTarget> piTarget = mEditor->GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = mEditor->GetPIDOMEventTarget();
if (!piTarget) { if (!piTarget) {
return; return;
} }

Просмотреть файл

@ -411,7 +411,7 @@ nsHTMLEditor::GrabberClicked()
mMouseMotionListenerP = new ResizerMouseMotionListener(this); mMouseMotionListenerP = new ResizerMouseMotionListener(this);
if (!mMouseMotionListenerP) {return NS_ERROR_NULL_POINTER;} if (!mMouseMotionListenerP) {return NS_ERROR_NULL_POINTER;}
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE); NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
res = piTarget->AddEventListenerByIID(mMouseMotionListenerP, res = piTarget->AddEventListenerByIID(mMouseMotionListenerP,
@ -441,7 +441,7 @@ nsHTMLEditor::EndMoving()
mPositioningShadow = nsnull; mPositioningShadow = nsnull;
} }
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
if (piTarget && mMouseMotionListenerP) { if (piTarget && mMouseMotionListenerP) {
#ifdef DEBUG #ifdef DEBUG

Просмотреть файл

@ -473,7 +473,7 @@ nsHTMLEditor::RemoveEventListeners()
return; return;
} }
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget);
if (piTarget && target) if (piTarget && target)
@ -5826,14 +5826,14 @@ nsHTMLEditor::IsActiveInDOMWindow()
return PR_TRUE; return PR_TRUE;
} }
already_AddRefed<nsPIDOMEventTarget> already_AddRefed<nsIDOMEventTarget>
nsHTMLEditor::GetPIDOMEventTarget() nsHTMLEditor::GetPIDOMEventTarget()
{ {
// Don't use getDocument here, because we have no way of knowing // Don't use getDocument here, because we have no way of knowing
// whether Init() was ever called. So we need to get the document // whether Init() was ever called. So we need to get the document
// ourselves, if it exists. // ourselves, if it exists.
NS_PRECONDITION(mDocWeak, "This editor has not been initialized yet"); NS_PRECONDITION(mDocWeak, "This editor has not been initialized yet");
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryReferent(mDocWeak.get()); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryReferent(mDocWeak.get());
return piTarget.forget(); return piTarget.forget();
} }

Просмотреть файл

@ -151,7 +151,7 @@ public:
virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent); virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent);
virtual already_AddRefed<nsIContent> GetFocusedContent(); virtual already_AddRefed<nsIContent> GetFocusedContent();
virtual PRBool IsActiveInDOMWindow(); virtual PRBool IsActiveInDOMWindow();
virtual already_AddRefed<nsPIDOMEventTarget> GetPIDOMEventTarget(); virtual already_AddRefed<nsIDOMEventTarget> GetPIDOMEventTarget();
virtual already_AddRefed<nsIContent> FindSelectionRoot(nsINode *aNode); virtual already_AddRefed<nsIContent> FindSelectionRoot(nsINode *aNode);
virtual PRBool IsAcceptableInputEvent(nsIDOMEvent* aEvent); virtual PRBool IsAcceptableInputEvent(nsIDOMEvent* aEvent);

Просмотреть файл

@ -40,7 +40,7 @@
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMNSHTMLElement.h" #include "nsIDOMNSHTMLElement.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMText.h" #include "nsIDOMText.h"
#include "nsIDOMCSSValue.h" #include "nsIDOMCSSValue.h"
@ -497,7 +497,7 @@ nsHTMLEditor::HideResizers(void)
// don't forget to remove the listeners ! // don't forget to remove the listeners !
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget);
if (target && mMouseMotionListenerP) if (target && mMouseMotionListenerP)
@ -606,7 +606,7 @@ nsHTMLEditor::StartResizing(nsIDOMElement *aHandle)
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget(); nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget); nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget);
NS_ENSURE_TRUE(target, NS_ERROR_FAILURE); NS_ENSURE_TRUE(target, NS_ERROR_FAILURE);

Просмотреть файл

@ -1715,7 +1715,7 @@ nsPlaintextEditor::SelectEntireDocument(nsISelection *aSelection)
return NS_OK; return NS_OK;
} }
already_AddRefed<nsPIDOMEventTarget> already_AddRefed<nsIDOMEventTarget>
nsPlaintextEditor::GetPIDOMEventTarget() nsPlaintextEditor::GetPIDOMEventTarget()
{ {
NS_IF_ADDREF(mEventTarget); NS_IF_ADDREF(mEventTarget);

Просмотреть файл

@ -145,7 +145,7 @@ public:
virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent); virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent);
virtual already_AddRefed<nsPIDOMEventTarget> GetPIDOMEventTarget(); virtual already_AddRefed<nsIDOMEventTarget> GetPIDOMEventTarget();
virtual nsresult BeginIMEComposition(); virtual nsresult BeginIMEComposition();
virtual nsresult UpdateIMEComposition(const nsAString &aCompositionString, virtual nsresult UpdateIMEComposition(const nsAString &aCompositionString,

Просмотреть файл

@ -102,7 +102,7 @@
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIViewManager.h" #include "nsIViewManager.h"
#include "nsIView.h" #include "nsIView.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIEventListenerManager.h" #include "nsIEventListenerManager.h"
#include "nsIDOMEventGroup.h" #include "nsIDOMEventGroup.h"
#include "nsIDOMDragEvent.h" #include "nsIDOMDragEvent.h"
@ -112,10 +112,10 @@
// GetEventReceiver // GetEventReceiver
// //
// A helper routine that navigates the tricky path from a |nsWebBrowser| to // A helper routine that navigates the tricky path from a |nsWebBrowser| to
// a |nsPIDOMEventTarget| via the window root and chrome event handler. // a |nsIDOMEventTarget| via the window root and chrome event handler.
// //
static nsresult static nsresult
GetPIDOMEventTarget( nsWebBrowser* inBrowser, nsPIDOMEventTarget** aTarget) GetPIDOMEventTarget( nsWebBrowser* inBrowser, nsIDOMEventTarget** aTarget)
{ {
NS_ENSURE_ARG_POINTER(inBrowser); NS_ENSURE_ARG_POINTER(inBrowser);
@ -127,7 +127,7 @@ GetPIDOMEventTarget( nsWebBrowser* inBrowser, nsPIDOMEventTarget** aTarget)
NS_ENSURE_TRUE(domWindowPrivate, NS_ERROR_FAILURE); NS_ENSURE_TRUE(domWindowPrivate, NS_ERROR_FAILURE);
nsPIDOMWindow *rootWindow = domWindowPrivate->GetPrivateRoot(); nsPIDOMWindow *rootWindow = domWindowPrivate->GetPrivateRoot();
NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE); NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE);
nsCOMPtr<nsPIDOMEventTarget> piTarget = nsCOMPtr<nsIDOMEventTarget> piTarget =
do_QueryInterface(rootWindow->GetChromeEventHandler()); do_QueryInterface(rootWindow->GetChromeEventHandler());
NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE); NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
*aTarget = piTarget; *aTarget = piTarget;
@ -888,7 +888,7 @@ nsDocShellTreeOwner::AddChromeListeners()
} }
// register dragover and drop event listeners with the listener manager // register dragover and drop event listeners with the listener manager
nsCOMPtr<nsPIDOMEventTarget> piTarget; nsCOMPtr<nsIDOMEventTarget> piTarget;
GetPIDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget)); GetPIDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget));
nsCOMPtr<nsIDOMEventGroup> sysGroup; nsCOMPtr<nsIDOMEventGroup> sysGroup;
@ -922,7 +922,7 @@ nsDocShellTreeOwner::RemoveChromeListeners()
NS_RELEASE(mChromeContextMenuListener); NS_RELEASE(mChromeContextMenuListener);
} }
nsCOMPtr<nsPIDOMEventTarget> piTarget; nsCOMPtr<nsIDOMEventTarget> piTarget;
GetPIDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget)); GetPIDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget));
if (!piTarget) if (!piTarget)
return NS_OK; return NS_OK;

Просмотреть файл

@ -66,7 +66,7 @@
#include "nsITooltipTextProvider.h" #include "nsITooltipTextProvider.h"
#include "nsCTooltipTextProvider.h" #include "nsCTooltipTextProvider.h"
#include "nsIDroppedLinkHandler.h" #include "nsIDroppedLinkHandler.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsCommandHandler.h" #include "nsCommandHandler.h"
class nsWebBrowser; class nsWebBrowser;
@ -225,7 +225,7 @@ private:
NS_IMETHOD HideTooltip ( ) ; NS_IMETHOD HideTooltip ( ) ;
nsWebBrowser* mWebBrowser; nsWebBrowser* mWebBrowser;
nsCOMPtr<nsPIDOMEventTarget> mEventTarget; nsCOMPtr<nsIDOMEventTarget> mEventTarget;
nsCOMPtr<nsITooltipTextProvider> mTooltipTextProvider; nsCOMPtr<nsITooltipTextProvider> mTooltipTextProvider;
// This must be a strong ref in order to make sure we can hide the tooltip // This must be a strong ref in order to make sure we can hide the tooltip
@ -292,7 +292,7 @@ private:
PRPackedBool mContextMenuListenerInstalled; PRPackedBool mContextMenuListenerInstalled;
nsWebBrowser* mWebBrowser; nsWebBrowser* mWebBrowser;
nsCOMPtr<nsPIDOMEventTarget> mEventTarget; nsCOMPtr<nsIDOMEventTarget> mEventTarget;
nsCOMPtr<nsIWebBrowserChrome> mWebBrowserChrome; nsCOMPtr<nsIWebBrowserChrome> mWebBrowserChrome;
}; // class ChromeContextMenuListener }; // class ChromeContextMenuListener

Просмотреть файл

@ -73,7 +73,7 @@
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMMouseEvent.h" #include "nsIDOMMouseEvent.h"
#include "nsIDOMKeyEvent.h" #include "nsIDOMKeyEvent.h"
#include "nsIDOMNode.h" #include "nsIDOMNode.h"
@ -645,7 +645,7 @@ mozInlineSpellChecker::RegisterEventListeners()
nsresult rv = editor->GetDocument(getter_AddRefs(doc)); nsresult rv = editor->GetDocument(getter_AddRefs(doc));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(doc, &rv); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(doc, &rv);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsIEventListenerManager* elmP = piTarget->GetListenerManager(PR_TRUE); nsIEventListenerManager* elmP = piTarget->GetListenerManager(PR_TRUE);
@ -678,7 +678,7 @@ mozInlineSpellChecker::UnregisterEventListeners()
editor->GetDocument(getter_AddRefs(doc)); editor->GetDocument(getter_AddRefs(doc));
NS_ENSURE_TRUE(doc, NS_ERROR_NULL_POINTER); NS_ENSURE_TRUE(doc, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(doc); nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(doc);
NS_ENSURE_TRUE(piTarget, NS_ERROR_NULL_POINTER); NS_ENSURE_TRUE(piTarget, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIEventListenerManager> elmP = nsCOMPtr<nsIEventListenerManager> elmP =

Просмотреть файл

@ -445,7 +445,7 @@ nsWidgetUtils::GetChromeEventHandler(nsIDOMWindow *aDOMWin,
nsIDOMEventTarget **aChromeTarget) nsIDOMEventTarget **aChromeTarget)
{ {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin)); nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin));
nsPIDOMEventTarget* chromeEventHandler = nsnull; nsIDOMEventTarget* chromeEventHandler = nsnull;
if (privateDOMWindow) { if (privateDOMWindow) {
chromeEventHandler = privateDOMWindow->GetChromeEventHandler(); chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
} }
@ -467,7 +467,7 @@ nsWidgetUtils::RemoveWindowListeners(nsIDOMWindow *aDOMWin)
} }
// Use capturing, otherwise the normal find next will get activated when ours should // Use capturing, otherwise the normal find next will get activated when ours should
nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(chromeEventHandler)); nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(chromeEventHandler));
// Remove DOM Text listener for IME text events // Remove DOM Text listener for IME text events
rv = piTarget->RemoveEventListenerByIID(static_cast<nsIDOMMouseListener*>(this), rv = piTarget->RemoveEventListenerByIID(static_cast<nsIDOMMouseListener*>(this),
@ -495,7 +495,7 @@ nsWidgetUtils::AttachWindowListeners(nsIDOMWindow *aDOMWin)
} }
// Use capturing, otherwise the normal find next will get activated when ours should // Use capturing, otherwise the normal find next will get activated when ours should
nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(chromeEventHandler)); nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(chromeEventHandler));
// Attach menu listeners, this will help us ignore keystrokes meant for menus // Attach menu listeners, this will help us ignore keystrokes meant for menus
rv = piTarget->AddEventListenerByIID(static_cast<nsIDOMMouseListener*>(this), rv = piTarget->AddEventListenerByIID(static_cast<nsIDOMMouseListener*>(this),

Просмотреть файл

@ -1711,7 +1711,7 @@ nsPresContext::MediaFeatureValuesChanged(PRBool aCallerWillRebuildStyleData)
if (!notifyList.IsEmpty()) { if (!notifyList.IsEmpty()) {
nsPIDOMWindow *win = mDocument->GetInnerWindow(); nsPIDOMWindow *win = mDocument->GetInnerWindow();
nsCOMPtr<nsPIDOMEventTarget> et = do_QueryInterface(win); nsCOMPtr<nsIDOMEventTarget> et = do_QueryInterface(win);
nsCxPusher pusher; nsCxPusher pusher;
for (PRUint32 i = 0, i_end = notifyList.Length(); i != i_end; ++i) { for (PRUint32 i = 0, i_end = notifyList.Length(); i != i_end; ++i) {
@ -2066,7 +2066,7 @@ MayHavePaintEventListener(nsPIDOMWindow* aInnerWindow)
if (aInnerWindow->HasPaintEventListeners()) if (aInnerWindow->HasPaintEventListeners())
return PR_TRUE; return PR_TRUE;
nsPIDOMEventTarget* parentTarget = aInnerWindow->GetParentTarget(); nsIDOMEventTarget* parentTarget = aInnerWindow->GetParentTarget();
if (!parentTarget) if (!parentTarget)
return PR_FALSE; return PR_FALSE;
@ -2096,7 +2096,7 @@ MayHavePaintEventListener(nsPIDOMWindow* aInnerWindow)
return MayHavePaintEventListener(window); return MayHavePaintEventListener(window);
nsCOMPtr<nsPIWindowRoot> root = do_QueryInterface(parentTarget); nsCOMPtr<nsPIWindowRoot> root = do_QueryInterface(parentTarget);
nsPIDOMEventTarget* tabChildGlobal; nsIDOMEventTarget* tabChildGlobal;
return root && return root &&
(tabChildGlobal = root->GetParentTarget()) && (tabChildGlobal = root->GetParentTarget()) &&
(manager = tabChildGlobal->GetListenerManager(PR_FALSE)) && (manager = tabChildGlobal->GetListenerManager(PR_FALSE)) &&

Просмотреть файл

@ -1123,7 +1123,7 @@ nsFormFillController::AddWindowListeners(nsIDOMWindow *aWindow)
return; return;
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow)); nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow));
nsPIDOMEventTarget* chromeEventHandler = nsnull; nsIDOMEventTarget* chromeEventHandler = nsnull;
if (privateDOMWindow) if (privateDOMWindow)
chromeEventHandler = privateDOMWindow->GetChromeEventHandler(); chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
@ -1185,7 +1185,7 @@ nsFormFillController::RemoveWindowListeners(nsIDOMWindow *aWindow)
mPwmgrInputs.Enumerate(RemoveForDOMDocumentEnumerator, domDoc); mPwmgrInputs.Enumerate(RemoveForDOMDocumentEnumerator, domDoc);
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow)); nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow));
nsPIDOMEventTarget* chromeEventHandler = nsnull; nsIDOMEventTarget* chromeEventHandler = nsnull;
if (privateDOMWindow) if (privateDOMWindow)
chromeEventHandler = privateDOMWindow->GetChromeEventHandler(); chromeEventHandler = privateDOMWindow->GetChromeEventHandler();

Просмотреть файл

@ -52,7 +52,7 @@
#include "nsIDOMKeyEvent.h" #include "nsIDOMKeyEvent.h"
#include "nsIDOMNSMouseEvent.h" #include "nsIDOMNSMouseEvent.h"
#include "nsIDOMDataTransfer.h" #include "nsIDOMDataTransfer.h"
#include "nsPIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsWeakPtr.h" #include "nsWeakPtr.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsTArray.h" #include "nsTArray.h"
@ -602,9 +602,9 @@ public:
// Additional type info for user defined events // Additional type info for user defined events
nsCOMPtr<nsIAtom> userType; nsCOMPtr<nsIAtom> userType;
// Event targets, needed by DOM Events // Event targets, needed by DOM Events
nsCOMPtr<nsPIDOMEventTarget> target; nsCOMPtr<nsIDOMEventTarget> target;
nsCOMPtr<nsPIDOMEventTarget> currentTarget; nsCOMPtr<nsIDOMEventTarget> currentTarget;
nsCOMPtr<nsPIDOMEventTarget> originalTarget; nsCOMPtr<nsIDOMEventTarget> originalTarget;
}; };
/** /**

Просмотреть файл

@ -744,7 +744,7 @@ PRBool nsWebShellWindow::ExecuteCloseHandler()
nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this); nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this);
nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell)); nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
nsCOMPtr<nsPIDOMEventTarget> eventTarget = do_QueryInterface(window); nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(window);
if (eventTarget) { if (eventTarget) {
nsCOMPtr<nsIContentViewer> contentViewer; nsCOMPtr<nsIContentViewer> contentViewer;