Bug 658714 Part 5: Search'n'replace nsPIDOMEventTarget to nsIDOMEventTarget. r=smaug
authorJonas Sicking <jonas@sicking.cc>
Thu, 23 Jun 2011 19:18:00 -0700
changeset 71653 830993c92036edd8ce92c85bf1a40207af55ebda
parent 71652 e849fa1da72bfa724be26a744f5c33a192a5a1e4
child 71654 ee4bd9f2cd7aa3286fc44a9a15d863ffe74611e7
push id219
push usermak77@bonardo.net
push dateFri, 24 Jun 2011 09:42:20 +0000
treeherdermozilla-inbound@537f0d13d96c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs658714
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 658714 Part 5: Search'n'replace nsPIDOMEventTarget to nsIDOMEventTarget. r=smaug
accessible/src/base/nsAccDocManager.cpp
content/base/public/nsDOMEventTargetWrapperCache.h
content/base/public/nsINode.h
content/base/src/nsContentUtils.cpp
content/base/src/nsDOMEventTargetWrapperCache.cpp
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsFrameLoader.cpp
content/base/src/nsFrameLoader.h
content/base/src/nsInProcessTabChildGlobal.cpp
content/base/src/nsWebSocket.cpp
content/events/public/Makefile.in
content/events/public/nsPIDOMEventTarget.h
content/events/src/nsDOMDataTransfer.cpp
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEventTargetHelper.cpp
content/events/src/nsDOMEventTargetHelper.h
content/events/src/nsEventDispatcher.cpp
content/events/src/nsEventListenerManager.cpp
content/events/src/nsEventListenerManager.h
content/events/src/nsEventListenerService.cpp
content/events/src/nsEventListenerService.h
content/html/content/src/nsGenericHTMLElement.cpp
content/smil/nsSMILTimeValueSpec.cpp
content/xbl/src/nsXBLEventHandler.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
content/xbl/src/nsXBLService.cpp
content/xbl/src/nsXBLWindowKeyHandler.cpp
content/xul/content/src/nsXULElement.cpp
content/xul/document/src/nsXULDocument.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsFocusManager.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsPIDOMWindow.h
dom/base/nsPIWindowRoot.h
dom/base/nsWindowRoot.cpp
dom/base/nsWindowRoot.h
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBDatabase.h
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBRequest.h
dom/indexedDB/IDBTransaction.cpp
dom/indexedDB/IDBTransaction.h
dom/ipc/TabChild.cpp
dom/src/events/nsJSEventListener.cpp
editor/libeditor/base/nsEditor.cpp
editor/libeditor/base/nsEditor.h
editor/libeditor/base/nsEditorEventListener.cpp
editor/libeditor/html/nsHTMLAbsPosition.cpp
editor/libeditor/html/nsHTMLEditor.cpp
editor/libeditor/html/nsHTMLEditor.h
editor/libeditor/html/nsHTMLObjectResizer.cpp
editor/libeditor/text/nsPlaintextEditor.cpp
editor/libeditor/text/nsPlaintextEditor.h
embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
embedding/browser/webBrowser/nsDocShellTreeOwner.h
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/widgetutils/src/nsWidgetUtils.cpp
layout/base/nsPresContext.cpp
toolkit/components/satchel/nsFormFillController.cpp
widget/public/nsGUIEvent.h
xpfe/appshell/src/nsWebShellWindow.cpp
--- a/accessible/src/base/nsAccDocManager.cpp
+++ b/accessible/src/base/nsAccDocManager.cpp
@@ -386,17 +386,17 @@ nsAccDocManager::IsEventTargetDocument(n
   return (contentType == nsIDocShellTreeItem::typeContent);
 }
 
 void
 nsAccDocManager::AddListeners(nsIDocument *aDocument,
                               PRBool aAddDOMContentLoadedListener)
 {
   nsPIDOMWindow *window = aDocument->GetWindow();
-  nsPIDOMEventTarget *target = window->GetChromeEventHandler();
+  nsIDOMEventTarget *target = window->GetChromeEventHandler();
   nsIEventListenerManager* elm = target->GetListenerManager(PR_TRUE);
   elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"),
                               NS_EVENT_FLAG_CAPTURE, nsnull);
 
   NS_LOG_ACCDOCCREATE_TEXT("  added 'pagehide' listener")
 
   if (aAddDOMContentLoadedListener) {
     elm->AddEventListenerByType(this, NS_LITERAL_STRING("DOMContentLoaded"),
--- a/content/base/public/nsDOMEventTargetWrapperCache.h
+++ b/content/base/public/nsDOMEventTargetWrapperCache.h
@@ -64,25 +64,25 @@ public:
     }
     else {
       *aParentObject = nsnull;
     }
   }
 
   static nsDOMEventTargetWrapperCache* FromSupports(nsISupports* aSupports)
   {
-    nsPIDOMEventTarget* target =
-      static_cast<nsPIDOMEventTarget*>(aSupports);
+    nsIDOMEventTarget* target =
+      static_cast<nsIDOMEventTarget*>(aSupports);
 #ifdef DEBUG
     {
-      nsCOMPtr<nsPIDOMEventTarget> target_qi =
+      nsCOMPtr<nsIDOMEventTarget> target_qi =
         do_QueryInterface(aSupports);
 
       // 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...
       NS_ASSERTION(target_qi == target, "Uh, fix QI!");
     }
 #endif
 
     return static_cast<nsDOMEventTargetWrapperCache*>(target);
   }
 
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -33,17 +33,17 @@
  * 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 nsINode_h___
 #define nsINode_h___
 
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsEvent.h"
 #include "nsPropertyTable.h"
 #include "nsTObserverArray.h"
 #include "nsINodeInfo.h"
 #include "nsCOMPtr.h"
 #include "nsWrapperCache.h"
 #include "nsIProgrammingLanguage.h" // for ::JAVASCRIPT
 #include "nsDOMError.h"
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -2504,17 +2504,17 @@ IsContextOnStack(nsIJSContextStack *aSta
     if (nsJSUtils::GetDynamicScriptContext(ctx) && ctx == aContext)
       return PR_TRUE;
   }
 
   return PR_FALSE;
 }
 
 PRBool
-nsCxPusher::Push(nsPIDOMEventTarget *aCurrentTarget)
+nsCxPusher::Push(nsIDOMEventTarget *aCurrentTarget)
 {
   if (mPushedSomething) {
     NS_ERROR("Whaaa! No double pushing with nsCxPusher::Push()!");
 
     return PR_FALSE;
   }
 
   NS_ENSURE_TRUE(aCurrentTarget, PR_FALSE);
@@ -2546,17 +2546,17 @@ nsCxPusher::Push(nsPIDOMEventTarget *aCu
   // If there's no native context in the script context it must be
   // in the process or being torn down. We don't want to notify the
   // script context about scripts having been evaluated in such a
   // case, calling with a null cx is fine in that case.
   return Push(cx);
 }
 
 PRBool
-nsCxPusher::RePush(nsPIDOMEventTarget *aCurrentTarget)
+nsCxPusher::RePush(nsIDOMEventTarget *aCurrentTarget)
 {
   if (!mPushedSomething) {
     return Push(aCurrentTarget);
   }
 
   if (aCurrentTarget) {
     nsresult rv;
     nsIScriptContext* scx =
@@ -3045,25 +3045,25 @@ nsContentUtils::DispatchChromeEvent(nsID
                                   aCancelable, getter_AddRefs(event),
                                   getter_AddRefs(target));
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ASSERTION(aDoc, "GetEventAndTarget lied?");
   if (!aDoc->GetWindow())
     return NS_ERROR_INVALID_ARG;
 
-  nsPIDOMEventTarget* piTarget = aDoc->GetWindow()->GetChromeEventHandler();
+  nsIDOMEventTarget* piTarget = aDoc->GetWindow()->GetChromeEventHandler();
   if (!piTarget)
     return NS_ERROR_INVALID_ARG;
 
   nsCOMPtr<nsIFrameLoaderOwner> flo = do_QueryInterface(piTarget);
   if (flo) {
     nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
     if (fl) {
-      nsPIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
+      nsIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
       piTarget = t ? t : piTarget;
     }
   }
 
   nsEventStatus status = nsEventStatus_eIgnore;
   rv = piTarget->DispatchDOMEvent(nsnull, event, nsnull, &status);
   if (aDefaultAction) {
     *aDefaultAction = (status != nsEventStatus_eConsumeNoDefault);
@@ -3237,17 +3237,17 @@ nsContentUtils::HasMutationListeners(nsI
       static_cast<nsIContent*>(aNode)->IsInNativeAnonymousSubtree()) {
     return PR_FALSE;
   }
 
   doc->MayDispatchMutationEvent(aTargetForSubtreeModified);
 
   // If we have a window, we can check it for mutation listeners now.
   if (aNode->IsInDoc()) {
-    nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(window));
+    nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(window));
     if (piTarget) {
       nsIEventListenerManager* manager = piTarget->GetListenerManager(PR_FALSE);
       if (manager) {
         PRBool hasListeners = PR_FALSE;
         manager->HasMutationListeners(&hasListeners);
         if (hasListeners) {
           return PR_TRUE;
         }
--- a/content/base/src/nsDOMEventTargetWrapperCache.cpp
+++ b/content/base/src/nsDOMEventTargetWrapperCache.cpp
@@ -38,17 +38,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsContentUtils.h"
 #include "nsDOMEventTargetWrapperCache.h"
 #include "nsIDocument.h"
 
 nsDOMEventTargetWrapperCache::~nsDOMEventTargetWrapperCache()
 {
-  nsISupports *supports = static_cast<nsPIDOMEventTarget*>(this);
+  nsISupports *supports = static_cast<nsIDOMEventTarget*>(this);
   nsContentUtils::ReleaseWrapper(supports, this);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMEventTargetWrapperCache)
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMEventTargetWrapperCache)
   NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -6230,17 +6230,17 @@ nsDocument::PreHandleEvent(nsEventChainP
   aVisitor.mCanHandle = PR_TRUE;
    // FIXME! This is a hack to make middle mouse paste working also in Editor.
    // Bug 329119
   aVisitor.mForceContentDispatch = PR_TRUE;
 
   // Load events must not propagate to |window| object, see bug 335251.
   if (aVisitor.mEvent->message != NS_LOAD) {
     nsGlobalWindow* window = static_cast<nsGlobalWindow*>(GetWindow());
-    aVisitor.mParentTarget = static_cast<nsPIDOMEventTarget*>(window);
+    aVisitor.mParentTarget = static_cast<nsIDOMEventTarget*>(window);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocument::AddGroupedEventListener(const nsAString& aType,
                                     nsIDOMEventListener *aListener,
                                     PRBool aUseCapture,
@@ -6994,17 +6994,17 @@ nsDocument::CanSavePresentation(nsIReque
   }
 
   nsPIDOMWindow* win = GetInnerWindow();
   if (win && win->TimeoutSuspendCount()) {
     return PR_FALSE;
   }
 
   // Check our event listener manager for unload/beforeunload listeners.
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(mScriptGlobalObject);
+  nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(mScriptGlobalObject);
   if (piTarget) {
     nsIEventListenerManager* manager =
       piTarget->GetListenerManager(PR_FALSE);
     if (manager && manager->HasUnloadListeners()) {
       return PR_FALSE;
     }
   }
 
@@ -7306,17 +7306,17 @@ nsDocument::CheckAncestryAndGetFrame(nsI
     return nsnull;
   }
 
   NS_ADDREF(frameElement);
   return frameElement;
 }
 
 void
-nsDocument::DispatchPageTransition(nsPIDOMEventTarget* aDispatchTarget,
+nsDocument::DispatchPageTransition(nsIDOMEventTarget* aDispatchTarget,
                                    const nsAString& aType,
                                    PRBool aPersisted)
 {
   if (aDispatchTarget) {
     nsCOMPtr<nsIDOMEvent> event;
     CreateEvent(NS_LITERAL_STRING("pagetransition"), getter_AddRefs(event));
     nsCOMPtr<nsIDOMPageTransitionEvent> ptEvent = do_QueryInterface(event);
     nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(ptEvent);
@@ -7376,17 +7376,17 @@ nsDocument::OnPageShow(PRBool aPersisted
     mAnimationController->OnPageShow();
   }
 #endif
 
   if (aPersisted) {
     SetImagesNeedAnimating(PR_TRUE);
   }
 
-  nsCOMPtr<nsPIDOMEventTarget> target =
+  nsCOMPtr<nsIDOMEventTarget> target =
     aDispatchStartTarget ? do_QueryInterface(aDispatchStartTarget) :
                            do_QueryInterface(GetWindow());
   DispatchPageTransition(target, NS_LITERAL_STRING("pageshow"), aPersisted);
 }
 
 static PRBool
 NotifyPageHide(nsIDocument* aDocument, void* aData)
 {
@@ -7429,17 +7429,17 @@ nsDocument::OnPageHide(PRBool aPersisted
   }
 #endif
   
   if (aPersisted) {
     SetImagesNeedAnimating(PR_FALSE);
   }
 
   // Now send out a PageHide event.
-  nsCOMPtr<nsPIDOMEventTarget> target =
+  nsCOMPtr<nsIDOMEventTarget> target =
     aDispatchStartTarget ? do_QueryInterface(aDispatchStartTarget) :
                            do_QueryInterface(GetWindow());
   DispatchPageTransition(target, NS_LITERAL_STRING("pagehide"), aPersisted);
 
   mVisible = PR_FALSE;
   EnumerateExternalResources(NotifyPageHide, &aPersisted);
   EnumerateFreezableElements(NotifyActivityChanged, nsnull);
 }
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -992,17 +992,17 @@ protected:
   // Return whether all the presshells for this document are safe to flush
   PRBool IsSafeToFlush() const;
   
   virtual PRInt32 GetDefaultNamespaceID() const
   {
     return kNameSpaceID_None;
   }
 
-  void DispatchPageTransition(nsPIDOMEventTarget* aDispatchTarget,
+  void DispatchPageTransition(nsIDOMEventTarget* aDispatchTarget,
                               const nsAString& aType,
                               PRBool aPersisted);
 
   virtual nsPIDOMWindow *GetWindowInternal() const;
   virtual nsPIDOMWindow *GetInnerWindowInternal();
   virtual nsIScriptGlobalObject* GetScriptHandlingObjectInternal() const;
   virtual PRBool InternalAllowXULXBL();
 
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -1899,19 +1899,19 @@ public:
                         const nsAString& aMessage, const nsAString& aJSON)
     : mFrameLoader(aFrameLoader), mMessage(aMessage), mJSON(aJSON) {}
 
   NS_IMETHOD Run()
   {
     nsInProcessTabChildGlobal* tabChild =
       static_cast<nsInProcessTabChildGlobal*>(mFrameLoader->mChildMessageManager.get());
     if (tabChild && tabChild->GetInnerManager()) {
-      nsFrameScriptCx cx(static_cast<nsPIDOMEventTarget*>(tabChild), tabChild);
+      nsFrameScriptCx cx(static_cast<nsIDOMEventTarget*>(tabChild), tabChild);
       nsRefPtr<nsFrameMessageManager> mm = tabChild->GetInnerManager();
-      mm->ReceiveMessage(static_cast<nsPIDOMEventTarget*>(tabChild), mMessage,
+      mm->ReceiveMessage(static_cast<nsIDOMEventTarget*>(tabChild), mMessage,
                          PR_FALSE, mJSON, nsnull, nsnull);
     }
     return NS_OK;
   }
   nsRefPtr<nsFrameLoader> mFrameLoader;
   nsString mMessage;
   nsString mJSON;
 };
@@ -2051,13 +2051,13 @@ nsFrameLoader::EnsureMessageManager()
     NS_ENSURE_TRUE(mMessageManager, NS_ERROR_OUT_OF_MEMORY);
     mChildMessageManager =
       new nsInProcessTabChildGlobal(mDocShell, mOwnerContent, mMessageManager);
     mMessageManager->SetCallbackData(this);
   }
   return NS_OK;
 }
 
-nsPIDOMEventTarget*
+nsIDOMEventTarget*
 nsFrameLoader::GetTabChildGlobalAsEventTarget()
 {
   return static_cast<nsInProcessTabChildGlobal*>(mChildMessageManager.get());
 }
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -191,17 +191,17 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFrameLoader, nsIFrameLoader)
   NS_DECL_NSIFRAMELOADER
   NS_DECL_NSICONTENTVIEWMANAGER
   NS_HIDDEN_(nsresult) CheckForRecursiveLoad(nsIURI* aURI);
   nsresult ReallyStartLoading();
   void Finalize();
   nsIDocShell* GetExistingDocShell() { return mDocShell; }
-  nsPIDOMEventTarget* GetTabChildGlobalAsEventTarget();
+  nsIDOMEventTarget* GetTabChildGlobalAsEventTarget();
   nsresult CreateStaticClone(nsIFrameLoader* aDest);
 
   /**
    * Called from the layout frame associated with this frame loader;
    * this notifies us to hook up with the widget and view.
    */
   PRBool Show(PRInt32 marginWidth, PRInt32 marginHeight,
               PRInt32 scrollbarPrefX, PRInt32 scrollbarPrefY,
--- a/content/base/src/nsInProcessTabChildGlobal.cpp
+++ b/content/base/src/nsInProcessTabChildGlobal.cpp
@@ -304,17 +304,17 @@ nsInProcessTabChildGlobal::InitTabChildG
 
   JSAutoRequest ar(cx);
   nsIXPConnect* xpc = nsContentUtils::XPConnect();
   const PRUint32 flags = nsIXPConnect::INIT_JS_STANDARD_CLASSES |
                          /*nsIXPConnect::OMIT_COMPONENTS_OBJECT ?  |*/
                          nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT;
 
   nsISupports* scopeSupports =
-    NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, this);
+    NS_ISUPPORTS_CAST(nsIDOMEventTarget*, this);
   JS_SetContextPrivate(cx, scopeSupports);
 
   nsresult rv =
     xpc->InitClassesWithNewWrappedGlobal(cx, scopeSupports,
                                          NS_GET_IID(nsISupports),
                                          GetPrincipal(), nsnull,
                                          flags, getter_AddRefs(mGlobal));
   NS_ENSURE_SUCCESS(rv, false);
--- a/content/base/src/nsWebSocket.cpp
+++ b/content/base/src/nsWebSocket.cpp
@@ -1122,30 +1122,30 @@ nsWebSocket::UpdateMustKeepAlive()
           (!mTriggeredCloseEvent &&
            mListenerManager->HasListenersFor(NS_LITERAL_STRING("close")));
       }
     }
   }
 
   if (mKeepingAlive && !shouldKeepAlive) {
     mKeepingAlive = PR_FALSE;
-    static_cast<nsPIDOMEventTarget*>(this)->Release();
+    static_cast<nsIDOMEventTarget*>(this)->Release();
   } else if (!mKeepingAlive && shouldKeepAlive) {
     mKeepingAlive = PR_TRUE;
-    static_cast<nsPIDOMEventTarget*>(this)->AddRef();
+    static_cast<nsIDOMEventTarget*>(this)->AddRef();
   }
 }
 
 void
 nsWebSocket::DontKeepAliveAnyMore()
 {
   NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
   if (mKeepingAlive) {
     mKeepingAlive = PR_FALSE;
-    static_cast<nsPIDOMEventTarget*>(this)->Release();
+    static_cast<nsIDOMEventTarget*>(this)->Release();
   }
   mCheckMustKeepAlive = PR_FALSE;
 }
 
 NS_IMETHODIMP
 nsWebSocket::RemoveEventListener(const nsAString& aType,
                                  nsIDOMEventListener* aListener,
                                  PRBool aUseCapture)
--- a/content/events/public/Makefile.in
+++ b/content/events/public/Makefile.in
@@ -48,17 +48,16 @@ XPIDL_MODULE	= content_events
 EXPORTS		= \
 		nsMutationEvent.h \
 		nsIEventListenerManager.h \
 		nsIPrivateDOMEvent.h \
 		nsIPrivateTextEvent.h \
 		nsIPrivateTextRange.h \
 		nsPLDOMEvent.h \
 		nsEventDispatcher.h \
-		nsPIDOMEventTarget.h \
 		nsEventStates.h \
 		$(NULL)
 
 XPIDLSRCS	= \
 		nsIEventListenerService.idl \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/content/events/public/nsPIDOMEventTarget.h
+++ /dev/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_)
--- a/content/events/src/nsDOMDataTransfer.cpp
+++ b/content/events/src/nsDOMDataTransfer.cpp
@@ -464,17 +464,17 @@ nsDOMDataTransfer::MozGetDataAt(const ns
         return NS_ERROR_DOM_SECURITY_ERR;
 
       if (!formatitem.mData) {
         FillInExternalDragData(formatitem, aIndex);
       } else {
         nsCOMPtr<nsISupports> data;
         formatitem.mData->GetAsISupports(getter_AddRefs(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) {
           nsresult rv = NS_OK;
           nsIScriptContext* c = pt->GetContextForEventHandlers(&rv);
           NS_ENSURE_TRUE(c && NS_SUCCEEDED(rv), NS_ERROR_DOM_SECURITY_ERR);
           nsIScriptObjectPrincipal* sp = c->GetObjectPrincipal();
           NS_ENSURE_TRUE(sp, NS_ERROR_DOM_SECURITY_ERR);
           nsIPrincipal* dataPrincipal = sp->GetPrincipal();
           NS_ENSURE_TRUE(dataPrincipal, NS_ERROR_DOM_SECURITY_ERR);
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -275,20 +275,20 @@ NS_METHOD nsDOMEvent::GetType(nsAString&
     return NS_OK;
   }
 
   aType.Truncate();
   return NS_OK;
 }
 
 static nsresult
-GetDOMEventTarget(nsPIDOMEventTarget* aTarget,
+GetDOMEventTarget(nsIDOMEventTarget* aTarget,
                   nsIDOMEventTarget** aDOMTarget)
 {
-  nsPIDOMEventTarget* realTarget =
+  nsIDOMEventTarget* realTarget =
     aTarget ? aTarget->GetTargetForDOMEvent() : aTarget;
   if (realTarget) {
     return CallQueryInterface(realTarget, aDOMTarget);
   }
 
   *aDOMTarget = nsnull;
   return NS_OK;
 }
--- a/content/events/src/nsDOMEventTargetHelper.cpp
+++ b/content/events/src/nsDOMEventTargetHelper.cpp
@@ -75,17 +75,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mListenerManager)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mScriptContext)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOwner)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 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_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMEventTargetHelper)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMEventTargetHelper)
 
 NS_IMPL_DOMTARGET_DEFAULTS(nsDOMEventTargetHelper);
 
@@ -135,17 +135,17 @@ nsDOMEventTargetHelper::AddEventListener
   return elm->AddEventListenerByType(aListener, aType, flags, nsnull);
 }
 
 NS_IMETHODIMP
 nsDOMEventTargetHelper::DispatchEvent(nsIDOMEvent* aEvent, PRBool* aRetVal)
 {
   nsEventStatus status = nsEventStatus_eIgnore;
   nsresult rv =
-    nsEventDispatcher::DispatchDOMEvent(static_cast<nsPIDOMEventTarget*>(this),
+    nsEventDispatcher::DispatchDOMEvent(static_cast<nsIDOMEventTarget*>(this),
                                         nsnull, aEvent, nsnull, &status);
 
   *aRetVal = (status != nsEventStatus_eConsumeNoDefault);
   return rv;
 }
 
 nsresult
 nsDOMEventTargetHelper::RemoveAddEventListener(const nsAString& aType,
@@ -194,31 +194,31 @@ nsDOMEventTargetHelper::PostHandleEvent(
 
 nsresult
 nsDOMEventTargetHelper::DispatchDOMEvent(nsEvent* aEvent,
                                          nsIDOMEvent* aDOMEvent,
                                          nsPresContext* aPresContext,
                                          nsEventStatus* aEventStatus)
 {
   return
-    nsEventDispatcher::DispatchDOMEvent(static_cast<nsPIDOMEventTarget*>(this),
+    nsEventDispatcher::DispatchDOMEvent(static_cast<nsIDOMEventTarget*>(this),
                                         aEvent, aDOMEvent, aPresContext,
                                         aEventStatus);
 }
 
 nsIEventListenerManager*
 nsDOMEventTargetHelper::GetListenerManager(PRBool aCreateIfNotFound)
 {
   if (!mListenerManager) {
     if (!aCreateIfNotFound) {
       return nsnull;
     }
     nsresult rv = NS_NewEventListenerManager(getter_AddRefs(mListenerManager));
     NS_ENSURE_SUCCESS(rv, nsnull);
-    mListenerManager->SetListenerTarget(static_cast<nsPIDOMEventTarget*>(this));
+    mListenerManager->SetListenerTarget(static_cast<nsIDOMEventTarget*>(this));
   }
 
   return mListenerManager;
 }
 
 nsresult
 nsDOMEventTargetHelper::AddEventListenerByIID(nsIDOMEventListener *aListener,
                                               const nsIID& aIID)
--- a/content/events/src/nsDOMEventTargetHelper.h
+++ b/content/events/src/nsDOMEventTargetHelper.h
@@ -36,17 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsDOMEventTargetHelper_h_
 #define nsDOMEventTargetHelper_h_
 
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsPIDOMWindow.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIEventListenerManager.h"
 #include "nsIScriptContext.h"
 
@@ -68,17 +68,17 @@ protected:
 
 class nsDOMEventTargetHelper : public nsIDOMEventTarget
 {
 public:
   nsDOMEventTargetHelper() {}
   virtual ~nsDOMEventTargetHelper() {}
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMEventTargetHelper,
-                                           nsPIDOMEventTarget)
+                                           nsIDOMEventTarget)
 
   NS_DECL_NSIDOMEVENTTARGET
 
   PRBool HasListenersFor(const nsAString& aType)
   {
     return mListenerManager && mListenerManager->HasListenersFor(aType);
   }
   nsresult RemoveAddEventListener(const nsAString& aType,
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -32,17 +32,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsEventDispatcher.h"
 #include "nsDOMEvent.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsPresContext.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsEventListenerManager.h"
 #include "nsContentUtils.h"
 #include "nsDOMError.h"
 #include "mozilla/FunctionTimer.h"
 #include "nsMutationEvent.h"
 #include NEW_H
@@ -59,22 +59,22 @@
 #define NS_TARGET_CHAIN_MAY_HAVE_MANAGER        (1 << 2)
 
 static nsEventTargetChainItem* gCachedETCI = nsnull;
 
 // nsEventTargetChainItem represents a single item in the event target chain.
 class nsEventTargetChainItem
 {
 private:
-  nsEventTargetChainItem(nsPIDOMEventTarget* aTarget,
+  nsEventTargetChainItem(nsIDOMEventTarget* aTarget,
                          nsEventTargetChainItem* aChild = nsnull);
 
 public:
   static nsEventTargetChainItem* Create(nsFixedSizeAllocator* aAllocator, 
-                                        nsPIDOMEventTarget* aTarget,
+                                        nsIDOMEventTarget* aTarget,
                                         nsEventTargetChainItem* aChild = nsnull)
   {
     void* place = nsnull;
     if (gCachedETCI) {
       place = gCachedETCI;
       gCachedETCI = gCachedETCI->mNext;
     } else {
       place = aAllocator->Alloc(sizeof(nsEventTargetChainItem));
@@ -104,22 +104,22 @@ public:
   }
 
   PRBool IsValid()
   {
     NS_WARN_IF_FALSE(!!(mTarget), "Event target is not valid!");
     return !!(mTarget);
   }
 
-  nsPIDOMEventTarget* GetNewTarget()
+  nsIDOMEventTarget* GetNewTarget()
   {
     return mNewTarget;
   }
 
-  void SetNewTarget(nsPIDOMEventTarget* aNewTarget)
+  void SetNewTarget(nsIDOMEventTarget* aNewTarget)
   {
     mNewTarget = aNewTarget;
   }
 
   void SetForceContentDispatch(PRBool aForce)
   {
     if (aForce) {
       mFlags |= NS_TARGET_CHAIN_FORCE_CONTENT_DISPATCH;
@@ -156,17 +156,17 @@ public:
     }
   }
 
   PRBool MayHaveListenerManager()
   {
     return !!(mFlags & NS_TARGET_CHAIN_MAY_HAVE_MANAGER);
   }
   
-  nsPIDOMEventTarget* CurrentTarget()
+  nsIDOMEventTarget* CurrentTarget()
   {
     return mTarget;
   }
 
   /**
    * Dispatches event through the event target chain.
    * Handles capture, target and bubble phases both in default
    * and system event group and calls also PostHandleEvent for each
@@ -227,39 +227,39 @@ public:
   static PRUint32 MaxEtciCount() { return sMaxEtciCount; }
 
   static void ResetMaxEtciCount()
   {
     NS_ASSERTION(!sCurrentEtciCount, "Wrong time to call ResetMaxEtciCount()!");
     sMaxEtciCount = 0;
   }
 
-  nsCOMPtr<nsPIDOMEventTarget>      mTarget;
+  nsCOMPtr<nsIDOMEventTarget>      mTarget;
   nsEventTargetChainItem*           mChild;
   union {
     nsEventTargetChainItem*         mParent;
      // This is used only when caching ETCI objects.
     nsEventTargetChainItem*         mNext;
   };
   PRUint16                          mFlags;
   PRUint16                          mItemFlags;
   nsCOMPtr<nsISupports>             mItemData;
   // Event retargeting must happen whenever mNewTarget is non-null.
-  nsCOMPtr<nsPIDOMEventTarget>      mNewTarget;
+  nsCOMPtr<nsIDOMEventTarget>      mNewTarget;
   // Cache mTarget's event listener manager.
   nsRefPtr<nsEventListenerManager>  mManager;
 
   static PRUint32                   sMaxEtciCount;
   static PRUint32                   sCurrentEtciCount;
 };
 
 PRUint32 nsEventTargetChainItem::sMaxEtciCount = 0;
 PRUint32 nsEventTargetChainItem::sCurrentEtciCount = 0;
 
-nsEventTargetChainItem::nsEventTargetChainItem(nsPIDOMEventTarget* aTarget,
+nsEventTargetChainItem::nsEventTargetChainItem(nsIDOMEventTarget* aTarget,
                                                nsEventTargetChainItem* aChild)
 : mChild(aChild), mParent(nsnull), mFlags(0), mItemFlags(0)
 {
   mTarget = aTarget->GetTargetForEventTargetChain();
   if (mChild) {
     mChild->mParent = this;
   }
 
@@ -293,17 +293,17 @@ nsEventTargetChainItem::PostHandleEvent(
 nsresult
 nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor, PRUint32 aFlags,
                                                nsDispatchingCallback* aCallback,
                                                PRBool aMayHaveNewListenerManagers,
                                                nsCxPusher* aPusher)
 {
   PRUint32 createdELMs = nsEventListenerManager::sCreatedCount;
   // Save the target so that it can be restored later.
-  nsCOMPtr<nsPIDOMEventTarget> firstTarget = aVisitor.mEvent->target;
+  nsCOMPtr<nsIDOMEventTarget> firstTarget = aVisitor.mEvent->target;
 
   // Capture
   nsEventTargetChainItem* item = this;
   aVisitor.mEvent->flags |= NS_EVENT_FLAG_CAPTURE;
   aVisitor.mEvent->flags &= ~NS_EVENT_FLAG_BUBBLE;
   while (item->mChild) {
     if ((!(aVisitor.mEvent->flags & NS_EVENT_FLAG_NO_CONTENT_DISPATCH) ||
          item->ForceContentDispatch()) &&
@@ -313,17 +313,17 @@ nsEventTargetChainItem::HandleEventTarge
                         createdELMs != nsEventListenerManager::sCreatedCount,
                         aPusher);
     }
 
     if (item->GetNewTarget()) {
       // item is at anonymous boundary. Need to retarget for the child items.
       nsEventTargetChainItem* nextTarget = item->mChild;
       while (nextTarget) {
-        nsPIDOMEventTarget* newTarget = nextTarget->GetNewTarget();
+        nsIDOMEventTarget* newTarget = nextTarget->GetNewTarget();
         if (newTarget) {
           aVisitor.mEvent->target = newTarget;
           break;
         }
         nextTarget = nextTarget->mChild;
       }
     }
 
@@ -346,17 +346,17 @@ nsEventTargetChainItem::HandleEventTarge
   if (aFlags & NS_EVENT_FLAG_SYSTEM_EVENT) {
     item->PostHandleEvent(aVisitor);
   }
 
   // Bubble
   aVisitor.mEvent->flags &= ~NS_EVENT_FLAG_CAPTURE;
   item = item->mParent;
   while (item) {
-    nsPIDOMEventTarget* newTarget = item->GetNewTarget();
+    nsIDOMEventTarget* newTarget = item->GetNewTarget();
     if (newTarget) {
       // Item is at anonymous boundary. Need to retarget for the current item
       // and for parent items.
       aVisitor.mEvent->target = newTarget;
     }
 
     if (!(aVisitor.mEvent->flags & NS_EVENT_FLAG_CANT_BUBBLE) || newTarget) {
       if ((!(aVisitor.mEvent->flags & NS_EVENT_FLAG_NO_CONTENT_DISPATCH) ||
@@ -463,17 +463,17 @@ void NS_ShutdownChainItemPool() { ChainI
 
 /* static */ nsresult
 nsEventDispatcher::Dispatch(nsISupports* aTarget,
                             nsPresContext* aPresContext,
                             nsEvent* aEvent,
                             nsIDOMEvent* aDOMEvent,
                             nsEventStatus* aEventStatus,
                             nsDispatchingCallback* aCallback,
-                            nsCOMArray<nsPIDOMEventTarget>* aTargets)
+                            nsCOMArray<nsIDOMEventTarget>* aTargets)
 {
   NS_ASSERTION(aEvent, "Trying to dispatch without nsEvent!");
   NS_ENSURE_TRUE(!NS_IS_EVENT_IN_DISPATCH(aEvent),
                  NS_ERROR_ILLEGAL_VALUE);
   NS_ASSERTION(!aTargets || !aEvent->message, "Wrong parameters!");
 
   // If we're dispatching an already created DOMEvent object, make
   // sure it is initialized!
@@ -482,17 +482,17 @@ nsEventDispatcher::Dispatch(nsISupports*
                  NS_ERROR_DOM_UNSPECIFIED_EVENT_TYPE_ERR);
 
 #ifdef NS_FUNCTION_TIMER
   const char* timer_event_name = nsDOMEvent::GetEventName(aEvent->message);
   NS_TIME_FUNCTION_MIN_FMT(20, "Dispatching '%s' event",
                            timer_event_name ? timer_event_name : "<other>");
 #endif
 
-  nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aTarget);
+  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aTarget);
 
   PRBool retargeted = PR_FALSE;
 
   if (aEvent->flags & NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS) {
     nsCOMPtr<nsIContent> content = do_QueryInterface(target);
     if (content && content->IsInNativeAnonymousSubtree()) {
       nsCOMPtr<nsPIDOMEventTarget> newTarget =
         do_QueryInterface(content->FindFirstNonNativeAnonymous());
@@ -513,24 +513,24 @@ nsEventDispatcher::Dispatch(nsISupports*
       }
     }
 
     NS_ENSURE_STATE(node);
     nsIDocument* doc = node->GetOwnerDoc();
     if (!nsContentUtils::IsChromeDoc(doc)) {
       nsPIDOMWindow* win = doc ? doc->GetInnerWindow() : nsnull;
       // 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);
 
       nsCOMPtr<nsIFrameLoaderOwner> flo = do_QueryInterface(piTarget);
       if (flo) {
         nsRefPtr<nsFrameLoader> fl = flo->GetFrameLoader();
         if (fl) {
-          nsPIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
+          nsIDOMEventTarget* t = fl->GetTabChildGlobalAsEventTarget();
           piTarget = t ? t : piTarget;
         }
       }
       
       // Set the target to be the original dispatch target,
       aEvent->target = target;
       // but use chrome event handler or TabChildGlobal for event target chain.
       target = piTarget;
@@ -614,17 +614,17 @@ nsEventDispatcher::Dispatch(nsISupports*
   nsEventStatus status = aEventStatus ? *aEventStatus : nsEventStatus_eIgnore;
   nsEventChainPreVisitor preVisitor(aPresContext, aEvent, aDOMEvent, status,
                                     isInAnon);
   targetEtci->PreHandleEvent(preVisitor);
 
   if (preVisitor.mCanHandle) {
     // At least the original target can handle the event.
     // 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);
     nsEventTargetChainItem* topEtci = targetEtci;
     while (preVisitor.mParentTarget) {
       nsEventTargetChainItem* parentEtci =
         nsEventTargetChainItem::Create(pool.GetPool(), preVisitor.mParentTarget,
                                        topEtci);
       if (!parentEtci) {
         rv = NS_ERROR_OUT_OF_MEMORY;
--- a/content/events/src/nsEventListenerManager.cpp
+++ b/content/events/src/nsEventListenerManager.cpp
@@ -1087,17 +1087,17 @@ nsEventListenerManager::CompileEventHand
 
   return result;
 }
 
 nsresult
 nsEventListenerManager::HandleEventSubType(nsListenerStruct* aListenerStruct,
                                            nsIDOMEventListener* aListener,
                                            nsIDOMEvent* aDOMEvent,
-                                           nsPIDOMEventTarget* aCurrentTarget,
+                                           nsIDOMEventTarget* aCurrentTarget,
                                            PRUint32 aPhaseFlags,
                                            nsCxPusher* aPusher)
 {
   nsresult result = NS_OK;
 
   // If this is a script handler and we haven't yet
   // compiled the event handler itself
   if ((aListenerStruct->mFlags & NS_PRIV_EVENT_FLAG_SCRIPT) &&
@@ -1148,17 +1148,17 @@ static const EventDispatchData* sLatestE
 * Causes a check for event listeners and processing by them if they exist.
 * @param an event listener
 */
 
 nsresult
 nsEventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
                                             nsEvent* aEvent,
                                             nsIDOMEvent** aDOMEvent,
-                                            nsPIDOMEventTarget* aCurrentTarget,
+                                            nsIDOMEventTarget* aCurrentTarget,
                                             PRUint32 aFlags,
                                             nsEventStatus* aEventStatus,
                                             nsCxPusher* aPusher)
 {
   //Set the value of the internal PreventDefault flag properly based on aEventStatus
   if (*aEventStatus == nsEventStatus_eConsumeNoDefault) {
     aEvent->flags |= NS_EVENT_FLAG_NO_DEFAULT;
   }
@@ -1567,17 +1567,17 @@ PRBool
 nsEventListenerManager::HasListeners()
 {
   return !mListeners.IsEmpty();
 }
 
 nsresult
 nsEventListenerManager::GetListenerInfo(nsCOMArray<nsIEventListenerInfo>* aList)
 {
-  nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(mTarget);
+  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mTarget);
   NS_ENSURE_STATE(target);
   aList->Clear();
   PRUint32 count = mListeners.Length();
   for (PRUint32 i = 0; i < count; ++i) {
     const nsListenerStruct& ls = mListeners.ElementAt(i);
     PRBool capturing = !!(ls.mFlags & NS_EVENT_FLAG_CAPTURE);
     PRBool systemGroup = !!(ls.mGroupFlags & NS_EVENT_FLAG_SYSTEM_EVENT);
     PRBool allowsUntrusted = !!(ls.mFlags & NS_PRIV_EVENT_UNTRUSTED_PERMITTED);
--- a/content/events/src/nsEventListenerManager.h
+++ b/content/events/src/nsEventListenerManager.h
@@ -112,17 +112,17 @@ public:
   NS_IMETHOD CompileScriptEventListener(nsIScriptContext *aContext,
                                         void *aScopeObject,
                                         nsISupports *aObject,
                                         nsIAtom* aName, PRBool *aDidCompile);
 
   nsresult HandleEvent(nsPresContext* aPresContext,
                        nsEvent* aEvent, 
                        nsIDOMEvent** aDOMEvent,
-                       nsPIDOMEventTarget* aCurrentTarget,
+                       nsIDOMEventTarget* aCurrentTarget,
                        PRUint32 aFlags,
                        nsEventStatus* aEventStatus,
                        nsCxPusher* aPusher)
   {
     if (mListeners.IsEmpty() || aEvent->flags & NS_EVENT_FLAG_STOP_DISPATCH) {
       return NS_OK;
     }
 
@@ -144,17 +144,17 @@ public:
     }
     return HandleEventInternal(aPresContext, aEvent, aDOMEvent, aCurrentTarget,
                                aFlags, aEventStatus, aPusher);
   }
 
   nsresult HandleEventInternal(nsPresContext* aPresContext,
                                nsEvent* aEvent, 
                                nsIDOMEvent** aDOMEvent,
-                               nsPIDOMEventTarget* aCurrentTarget,
+                               nsIDOMEventTarget* aCurrentTarget,
                                PRUint32 aFlags,
                                nsEventStatus* aEventStatus,
                                nsCxPusher* aPusher);
 
   NS_IMETHOD Disconnect();
 
   NS_IMETHOD SetListenerTarget(nsISupports* aTarget);
 
@@ -186,17 +186,17 @@ public:
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsEventListenerManager,
                                            nsIEventListenerManager)
 
 protected:
   nsresult HandleEventSubType(nsListenerStruct* aListenerStruct,
                               nsIDOMEventListener* aListener,
                               nsIDOMEvent* aDOMEvent,
-                              nsPIDOMEventTarget* aCurrentTarget,
+                              nsIDOMEventTarget* aCurrentTarget,
                               PRUint32 aPhaseFlags,
                               nsCxPusher* aPusher);
   nsresult CompileEventHandlerInternal(nsIScriptContext *aContext,
                                        void *aScopeObject,
                                        nsISupports *aObject,
                                        nsIAtom *aName,
                                        nsListenerStruct *aListenerStruct,
                                        nsISupports* aCurrentTarget,
--- a/content/events/src/nsEventListenerService.cpp
+++ b/content/events/src/nsEventListenerService.cpp
@@ -32,17 +32,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #include "nsEventListenerService.h"
 #include "nsCOMArray.h"
 #include "nsEventListenerManager.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIVariant.h"
 #include "nsIServiceManager.h"
 #include "nsMemory.h"
 #include "nsContentUtils.h"
 #include "nsIXPConnect.h"
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsJSUtils.h"
@@ -197,17 +197,17 @@ nsEventListenerInfo::GetDebugObject(nsIS
 NS_IMETHODIMP
 nsEventListenerService::GetListenerInfoFor(nsIDOMEventTarget* aEventTarget,
                                            PRUint32* aCount,
                                            nsIEventListenerInfo*** aOutArray)
 {
   *aCount = 0;
   *aOutArray = nsnull;
   nsCOMArray<nsIEventListenerInfo> listenerInfos;
-  nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aEventTarget);
+  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aEventTarget);
   if (target) {
     nsCOMPtr<nsIEventListenerManager> elm =
       target->GetListenerManager(PR_FALSE);
     if (elm) {
       elm->GetListenerInfo(&listenerInfos);
     }
   }
 
@@ -230,31 +230,31 @@ nsEventListenerService::GetListenerInfoF
 
 NS_IMETHODIMP
 nsEventListenerService::GetEventTargetChainFor(nsIDOMEventTarget* aEventTarget,
                                                PRUint32* aCount,
                                                nsIDOMEventTarget*** aOutArray)
 {
   *aCount = 0;
   *aOutArray = nsnull;
-  nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(aEventTarget);
+  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(aEventTarget);
   NS_ENSURE_ARG(target);
   nsEvent event(PR_TRUE, NS_EVENT_TYPE_NULL);
-  nsCOMArray<nsPIDOMEventTarget> targets;
+  nsCOMArray<nsIDOMEventTarget> targets;
   nsresult rv = nsEventDispatcher::Dispatch(target, nsnull, &event,
                                             nsnull, nsnull, nsnull, &targets);
   NS_ENSURE_SUCCESS(rv, rv);
   PRInt32 count = targets.Count();
   if (count == 0) {
     return NS_OK;
   }
 
   *aOutArray =
     static_cast<nsIDOMEventTarget**>(
-      nsMemory::Alloc(sizeof(nsPIDOMEventTarget*) * count));
+      nsMemory::Alloc(sizeof(nsIDOMEventTarget*) * count));
   NS_ENSURE_TRUE(*aOutArray, NS_ERROR_OUT_OF_MEMORY);
 
   for (PRInt32 i = 0; i < count; ++i) {
     nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(targets[i]);
     (*aOutArray)[i] = target.forget().get();
   }
   *aCount = count;
 
--- a/content/events/src/nsEventListenerService.h
+++ b/content/events/src/nsEventListenerService.h
@@ -37,17 +37,17 @@
 
 #ifndef nsEventListenerService_h__
 #define nsEventListenerService_h__
 #include "nsIEventListenerService.h"
 #include "nsAutoPtr.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 #include "nsString.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsCycleCollectionParticipant.h"
 #include "jsapi.h"
 
 
 class nsEventListenerInfo : public nsIEventListenerInfo
 {
 public:
   nsEventListenerInfo(const nsAString& aType, nsIDOMEventListener* aListener,
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -1142,17 +1142,17 @@ nsGenericHTMLElement::GetEventListenerMa
     nsresult rv = NS_OK;
 
     // FIXME (https://bugzilla.mozilla.org/show_bug.cgi?id=431767)
     // nsDocument::GetInnerWindow can return an outer window in some cases,
     // we don't want to stick an event listener on an outer window, so
     // bail if it does.
     if (document &&
         (win = document->GetInnerWindow()) && win->IsInnerWindow()) {
-      nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(win));
+      nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(win));
       NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
 
       *aManager = piTarget->GetListenerManager(PR_TRUE);
 
       if (*aManager) {
         NS_ADDREF(*aTarget = win);
         NS_ADDREF(*aManager);
       }
--- a/content/smil/nsSMILTimeValueSpec.cpp
+++ b/content/smil/nsSMILTimeValueSpec.cpp
@@ -372,17 +372,17 @@ nsSMILTimeValueSpec::UnregisterEventList
 nsIEventListenerManager*
 nsSMILTimeValueSpec::GetEventListenerManager(Element* aTarget,
                                              nsIDOMEventGroup** aSystemGroup)
 {
   NS_ABORT_IF_FALSE(aTarget, "null target; can't get EventListenerManager");
   NS_ABORT_IF_FALSE(aSystemGroup && !*aSystemGroup,
       "Bad out param for system group");
 
-  nsCOMPtr<nsPIDOMEventTarget> piTarget;
+  nsCOMPtr<nsIDOMEventTarget> piTarget;
 
   if (mParams.mType == nsSMILTimeValueSpecParams::ACCESSKEY) {
     nsIDocument* doc = aTarget->GetCurrentDoc();
     if (!doc)
       return nsnull;
     nsPIDOMWindow* win = doc->GetWindow();
     if (!win)
       return nsnull;
--- a/content/xbl/src/nsXBLEventHandler.cpp
+++ b/content/xbl/src/nsXBLEventHandler.cpp
@@ -78,17 +78,17 @@ nsXBLEventHandler::HandleEvent(nsIDOMEve
       return NS_OK;
   }
 
   if (!EventMatched(aEvent))
     return NS_OK;
 
   nsCOMPtr<nsIDOMEventTarget> target;
   aEvent->GetCurrentTarget(getter_AddRefs(target));
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(target);
+  nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(target);
 
   mProtoHandler->ExecuteHandler(piTarget, aEvent);
 
   return NS_OK;
 }
 
 nsXBLMouseEventHandler::nsXBLMouseEventHandler(nsXBLPrototypeHandler* aHandler)
   : nsXBLEventHandler(aHandler)
@@ -128,17 +128,17 @@ nsXBLKeyEventHandler::ExecuteMatchedHand
 {
   nsCOMPtr<nsIDOMNSEvent> domNSEvent = do_QueryInterface(aKeyEvent);
   PRBool trustedEvent = PR_FALSE;
   if (domNSEvent)
     domNSEvent->GetIsTrusted(&trustedEvent);
 
   nsCOMPtr<nsIDOMEventTarget> target;
   aKeyEvent->GetCurrentTarget(getter_AddRefs(target));
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(target);
+  nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(target);
 
   PRBool executed = PR_FALSE;
   for (PRUint32 i = 0; i < mProtoHandlers.Length(); ++i) {
     nsXBLPrototypeHandler* handler = mProtoHandlers[i];
     PRBool hasAllowUntrustedAttr = handler->HasAllowUntrustedAttr();
     if ((trustedEvent ||
         (hasAllowUntrustedAttr && handler->AllowUntrustedEvents()) ||
         (!hasAllowUntrustedAttr && !mIsBoundToChrome)) &&
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -209,17 +209,17 @@ nsXBLPrototypeHandler::InitAccessKeys()
 
   // Get the menu access key value from prefs, overriding the default:
   kMenuAccessKey =
     Preferences::GetInt("ui.key.menuAccessKey", kMenuAccessKey);
   kAccelKey = Preferences::GetInt("ui.key.accelKey", kAccelKey);
 }
 
 nsresult
-nsXBLPrototypeHandler::ExecuteHandler(nsPIDOMEventTarget* aTarget,
+nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventTarget* aTarget,
                                       nsIDOMEvent* aEvent)
 {
   nsresult rv = NS_ERROR_FAILURE;
 
   // Prevent default action?
   if (mType & NS_HANDLER_TYPE_PREVENTDEFAULT) {
     aEvent->PreventDefault();
     // If we prevent default, then it's okay for
@@ -374,17 +374,17 @@ nsXBLPrototypeHandler::EnsureEventHandle
   if (pWindow) {
     pWindow->CacheXBLPrototypeHandler(this, aHandler);
   }
 
   return NS_OK;
 }
 
 nsresult
-nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEvent* aEvent)
+nsXBLPrototypeHandler::DispatchXBLCommand(nsIDOMEventTarget* aTarget, nsIDOMEvent* aEvent)
 {
   // 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.
 
   // See if preventDefault has been set.  If so, don't execute.
   PRBool preventDefault = PR_FALSE;
   nsCOMPtr<nsIDOMNSUIEvent> nsUIEvent(do_QueryInterface(aEvent));
   if (nsUIEvent)
@@ -542,17 +542,17 @@ already_AddRefed<nsIAtom>
 nsXBLPrototypeHandler::GetEventName()
 {
   nsIAtom* eventName = mEventName;
   NS_IF_ADDREF(eventName);
   return eventName;
 }
 
 already_AddRefed<nsIController>
-nsXBLPrototypeHandler::GetController(nsPIDOMEventTarget* aTarget)
+nsXBLPrototypeHandler::GetController(nsIDOMEventTarget* aTarget)
 {
   // 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.
   nsCOMPtr<nsIControllers> controllers;
 
   nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(aTarget));
   if (xulElement)
     xulElement->GetControllers(getter_AddRefs(controllers));
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -704,21 +704,21 @@ nsXBLService::ResolveTag(nsIContent* aCo
 //
 // AttachGlobalKeyHandler
 //
 // Creates a new key handler and prepares to listen to key events on the given
 // event receiver (either a document or an content node). If the receiver is content,
 // then extra work needs to be done to hook it up to the document (XXX WHY??)
 //
 NS_IMETHODIMP
-nsXBLService::AttachGlobalKeyHandler(nsPIDOMEventTarget* aTarget)
+nsXBLService::AttachGlobalKeyHandler(nsIDOMEventTarget* aTarget)
 {
   // check if the receiver is a content node (not a document), and hook
   // it to the document if that is the case.
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = aTarget;
+  nsCOMPtr<nsIDOMEventTarget> piTarget = aTarget;
   nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget));
   if (contentNode) {
     // Only attach if we're really in a document
     nsCOMPtr<nsIDocument> doc = contentNode->GetCurrentDoc();
     if (doc)
       piTarget = do_QueryInterface(doc); // We're a XUL keyset. Attach to our document.
   }
     
@@ -760,19 +760,19 @@ nsXBLService::AttachGlobalKeyHandler(nsP
 }
 
 //
 // DetachGlobalKeyHandler
 //
 // Removes a key handler added by DeatchGlobalKeyHandler.
 //
 NS_IMETHODIMP
-nsXBLService::DetachGlobalKeyHandler(nsPIDOMEventTarget* aTarget)
+nsXBLService::DetachGlobalKeyHandler(nsIDOMEventTarget* aTarget)
 {
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = aTarget;
+  nsCOMPtr<nsIDOMEventTarget> piTarget = aTarget;
   nsCOMPtr<nsIContent> contentNode(do_QueryInterface(aTarget));
   if (!contentNode) // detaching is only supported for content nodes
     return NS_ERROR_FAILURE;
 
   // Only attach if we're really in a document
   nsCOMPtr<nsIDocument> doc = contentNode->GetCurrentDoc();
   if (doc)
     piTarget = do_QueryInterface(doc);
--- a/content/xbl/src/nsXBLWindowKeyHandler.cpp
+++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp
@@ -174,17 +174,17 @@ nsXBLSpecialDocInfo::GetAllHandlers(cons
   }
 }
 
 // Init statics
 nsXBLSpecialDocInfo* nsXBLWindowKeyHandler::sXBLSpecialDocInfo = nsnull;
 PRUint32 nsXBLWindowKeyHandler::sRefCnt = 0;
 
 nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(nsIDOMElement* aElement,
-                                             nsPIDOMEventTarget* aTarget)
+                                             nsIDOMEventTarget* aTarget)
   : mTarget(aTarget),
     mHandler(nsnull),
     mUserHandler(nsnull)
 {
   mWeakPtrForElement = do_GetWeakReference(aElement);
   ++sRefCnt;
 }
 
@@ -561,17 +561,17 @@ nsXBLWindowKeyHandler::WalkHandlersAndEx
 
       // Check that there is an oncommand handler
       commandElt->GetAttribute(NS_LITERAL_STRING("oncommand"), value);
       if (value.IsEmpty()) {
         continue;  // nothing to do
       }
     }
 
-    nsCOMPtr<nsPIDOMEventTarget> piTarget;
+    nsCOMPtr<nsIDOMEventTarget> piTarget;
     nsCOMPtr<nsIDOMElement> element = GetElement();
     if (element) {
       piTarget = do_QueryInterface(commandElt);
     } else {
       piTarget = mTarget;
     }
 
     rv = currHandler->ExecuteHandler(piTarget, aKeyEvent);
@@ -590,17 +590,17 @@ nsXBLWindowKeyHandler::GetElement()
   nsIDOMElement* el = nsnull;
   element.swap(el);
   return el;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 nsresult
-NS_NewXBLWindowKeyHandler(nsIDOMElement* aElement, nsPIDOMEventTarget* aTarget,
+NS_NewXBLWindowKeyHandler(nsIDOMElement* aElement, nsIDOMEventTarget* aTarget,
                           nsXBLWindowKeyHandler** aResult)
 {
   *aResult = new nsXBLWindowKeyHandler(aElement, aTarget);
   if (!*aResult)
     return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(*aResult);
   return NS_OK;
 }
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -528,17 +528,17 @@ nsXULElement::GetEventListenerManagerFor
     if (!doc)
         return NS_ERROR_UNEXPECTED; // XXX
 
     nsPIDOMWindow *window;
     Element *root = doc->GetRootElement();
     if ((!root || root == this) && !mNodeInfo->Equals(nsGkAtoms::overlay) &&
         (window = doc->GetInnerWindow()) && window->IsInnerWindow()) {
 
-        nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(window);
+        nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(window);
         if (!piTarget)
             return NS_ERROR_UNEXPECTED;
 
         *aDefer = PR_FALSE;
         *aManager = piTarget->GetListenerManager(PR_TRUE);
         NS_ENSURE_STATE(*aManager);
         NS_ADDREF(*aManager);
         NS_ADDREF(*aTarget = window);
@@ -2187,17 +2187,17 @@ PopupListenerPropertyDtor(void* aObject,
     static_cast<nsIDOMEventListener*>(aPropertyValue);
   if (!listener) {
     return;
   }
   nsCOMPtr<nsIDOM3EventTarget> target =
     do_QueryInterface(static_cast<nsINode*>(aObject));
   if (target) {
     nsCOMPtr<nsIDOMEventGroup> systemGroup;
-    static_cast<nsPIDOMEventTarget*>(aObject)->
+    static_cast<nsIDOMEventTarget*>(aObject)->
       GetSystemEventGroup(getter_AddRefs(systemGroup));
     if (systemGroup) {
       target->RemoveGroupedEventListener(NS_LITERAL_STRING("mousedown"),
                                          listener, PR_FALSE, systemGroup);
 
       target->RemoveGroupedEventListener(NS_LITERAL_STRING("contextmenu"),
                                          listener, PR_FALSE, systemGroup);
     }
--- a/content/xul/document/src/nsXULDocument.cpp
+++ b/content/xul/document/src/nsXULDocument.cpp
@@ -1712,17 +1712,17 @@ nsXULDocument::AddElementToDocumentPre(E
 nsresult
 nsXULDocument::AddElementToDocumentPost(Element* aElement)
 {
     // We need to pay special attention to the keyset tag to set up a listener
     if (aElement->NodeInfo()->Equals(nsGkAtoms::keyset, kNameSpaceID_XUL)) {
         // Create our XUL key listener and hook it up.
         nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1"));
         if (xblService) {
-            nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(aElement));
+            nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(aElement));
             xblService->AttachGlobalKeyHandler(piTarget);
         }
     }
 
     // See if we need to attach a XUL template to this node
     PRBool needsHookup;
     nsresult rv = CheckTemplateBuilderHookup(aElement, &needsHookup);
     if (NS_FAILED(rv))
@@ -1788,17 +1788,17 @@ nsXULDocument::RemoveSubtreeFromDocument
 
     // Do a bunch of cleanup to remove an element from the XUL
     // document.
     nsresult rv;
 
     if (aElement->NodeInfo()->Equals(nsGkAtoms::keyset, kNameSpaceID_XUL)) {
         nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1"));
         if (xblService) {
-            nsCOMPtr<nsPIDOMEventTarget> piTarget(do_QueryInterface(aElement));
+            nsCOMPtr<nsIDOMEventTarget> piTarget(do_QueryInterface(aElement));
             xblService->DetachGlobalKeyHandler(piTarget);
         }
     }
 
     // 1. Remove any children from the document.
     PRUint32 count = aElement->GetChildCount();
 
     while (count-- > 0) {
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -1768,17 +1768,17 @@ nsDocShell::GetContentViewer(nsIContentV
     *aContentViewer = mContentViewer;
     NS_IF_ADDREF(*aContentViewer);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocShell::SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler)
 {
-    nsCOMPtr<nsPIDOMEventTarget> piTarget =
+    nsCOMPtr<nsIDOMEventTarget> piTarget =
       do_QueryInterface(aChromeEventHandler);
     // Weak reference. Don't addref.
     mChromeEventHandler = piTarget;
 
     nsCOMPtr<nsPIDOMWindow> win(do_QueryInterface(mScriptGlobal));
     if (win) {
         win->SetChromeEventHandler(piTarget);
     }
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -101,17 +101,17 @@
 #include "nsIURIFixup.h"
 #include "nsIWebBrowserFind.h"
 #include "nsIHttpChannel.h"
 #include "nsDocShellTransferableHooks.h"
 #include "nsIAuthPromptProvider.h"
 #include "nsISecureBrowserUI.h"
 #include "nsIObserver.h"
 #include "nsDocShellLoadTypes.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsILoadContext.h"
 #include "nsIWidget.h"
 #include "nsIWebShellServices.h"
 #include "nsILinkHandler.h"
 #include "nsIClipboardCommands.h"
 #include "nsICommandManager.h"
 #include "nsCRT.h"
 
@@ -763,17 +763,17 @@ protected:
     nsCOMPtr<nsIChannel>       mFailedChannel;
     PRUint32                   mFailedLoadType;
 
     // WEAK REFERENCES BELOW HERE.
     // Note these are intentionally not addrefd.  Doing so will create a cycle.
     // For that reasons don't use nsCOMPtr.
 
     nsIDocShellTreeOwner *     mTreeOwner; // Weak Reference
-    nsPIDOMEventTarget *       mChromeEventHandler; //Weak Reference
+    nsIDOMEventTarget *       mChromeEventHandler; //Weak Reference
 
     eCharsetReloadState        mCharsetReloadState;
 
     // Offset in the parent's child list.
     // -1 if the docshell is added dynamically to the parent shell.
     PRUint32                   mChildOffset;
     PRUint32                   mBusyFlags;
     PRUint32                   mAppType;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -7744,21 +7744,21 @@ nsEventReceiverSH::RegisterCompileHandle
 
   if (ObjectIsNativeWrapper(cx, obj)) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsIScriptContext *script_cx = nsJSUtils::GetStaticScriptContext(cx, obj);
   NS_ENSURE_TRUE(script_cx, NS_ERROR_UNEXPECTED);
 
-  nsCOMPtr<nsPIDOMEventTarget> piTarget =
+  nsCOMPtr<nsIDOMEventTarget> piTarget =
     do_QueryWrappedNative(wrapper, obj);
   if (!piTarget) {
     // Doesn't do events
-    NS_WARNING("Doesn't QI to nsPIDOMEventTarget?");
+    NS_WARNING("Doesn't QI to nsIDOMEventTarget?");
     return NS_OK;
   }
   
   nsIEventListenerManager* manager = piTarget->GetListenerManager(PR_TRUE);
   NS_ENSURE_TRUE(manager, NS_ERROR_UNEXPECTED);
 
   nsCOMPtr<nsIAtom> atom(do_GetAtom(nsDependentJSString(id)));
   NS_ENSURE_TRUE(atom, NS_ERROR_OUT_OF_MEMORY);
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -103,32 +103,32 @@ using namespace mozilla::dom;
     printf(format, NS_ConvertUTF16toUTF8(tag).get());  \
   }
 
 struct nsDelayedBlurOrFocusEvent
 {
   nsDelayedBlurOrFocusEvent(PRUint32 aType,
                             nsIPresShell* aPresShell,
                             nsIDocument* aDocument,
-                            nsPIDOMEventTarget* aTarget)
+                            nsIDOMEventTarget* aTarget)
    : mType(aType),
      mPresShell(aPresShell),
      mDocument(aDocument),
      mTarget(aTarget) { }
 
   nsDelayedBlurOrFocusEvent(const nsDelayedBlurOrFocusEvent& aOther)
    : mType(aOther.mType),
      mPresShell(aOther.mPresShell),
      mDocument(aOther.mDocument),
      mTarget(aOther.mTarget) { }
 
   PRUint32 mType;
   nsCOMPtr<nsIPresShell> mPresShell;
   nsCOMPtr<nsIDocument> mDocument;
-  nsCOMPtr<nsPIDOMEventTarget> mTarget;
+  nsCOMPtr<nsIDOMEventTarget> mTarget;
 };
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFocusManager)
   NS_INTERFACE_MAP_ENTRY(nsIFocusManager)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIFocusManager)
 NS_INTERFACE_MAP_END
@@ -1003,17 +1003,17 @@ nsFocusManager::FireDelayedEvents(nsIDoc
   NS_ENSURE_ARG(aDocument);
 
   // fire any delayed focus and blur events in the same order that they were added
   for (PRUint32 i = 0; i < mDelayedBlurFocusEvents.Length(); i++)
   {
     if (mDelayedBlurFocusEvents[i].mDocument == aDocument &&
         !aDocument->EventHandlingSuppressed()) {
       PRUint32 type = mDelayedBlurFocusEvents[i].mType;
-      nsCOMPtr<nsPIDOMEventTarget> target = mDelayedBlurFocusEvents[i].mTarget;
+      nsCOMPtr<nsIDOMEventTarget> target = mDelayedBlurFocusEvents[i].mTarget;
       nsCOMPtr<nsIPresShell> presShell = mDelayedBlurFocusEvents[i].mPresShell;
       mDelayedBlurFocusEvents.RemoveElementAt(i);
       SendFocusOrBlurEvent(type, presShell, aDocument, target, 0, PR_FALSE);
       --i;
     }
   }
 
   return NS_OK;
@@ -1846,17 +1846,17 @@ nsFocusManager::SendFocusOrBlurEvent(PRU
                                      nsISupports* aTarget,
                                      PRUint32 aFocusMethod,
                                      PRBool aWindowRaised,
                                      PRBool aIsRefocus)
 {
   NS_ASSERTION(aType == NS_FOCUS_CONTENT || aType == NS_BLUR_CONTENT,
                "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
   // handling on the document is suppressed, queue the event and fire it
   // later. For blur events, a non-zero value would be set for aFocusMethod.
   if (aFocusMethod && aDocument && aDocument->EventHandlingSuppressed()) {
     // aFlags is always 0 when aWindowRaised is true so this won't be called
     // on a window raise.
     NS_ASSERTION(!aWindowRaised, "aWindowRaised should not be set");
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1846,17 +1846,17 @@ nsGlobalWindow::SetNewDocument(nsIDocume
     // Get our private root. If it is equal to us, then we need to
     // attach our global key bindings that handles browser scrolling
     // and other browser commands.
     nsIDOMWindowInternal *internal = nsGlobalWindow::GetPrivateRoot();
 
     if (internal == static_cast<nsIDOMWindowInternal *>(this)) {
       nsCOMPtr<nsIXBLService> xblService = do_GetService("@mozilla.org/xbl;1");
       if (xblService) {
-        nsCOMPtr<nsPIDOMEventTarget> piTarget =
+        nsCOMPtr<nsIDOMEventTarget> piTarget =
           do_QueryInterface(mChromeEventHandler);
         xblService->AttachGlobalKeyHandler(piTarget);
       }
     }
   }
 
   /* No mDocShell means we're already been partially closed down.  When that
      happens, setting status isn't a big requirement, so don't. (Doesn't happen
@@ -2512,27 +2512,27 @@ nsGlobalWindow::GetIsTabModalPromptAllow
     nsCOMPtr<nsIContentViewer> cv;
     mDocShell->GetContentViewer(getter_AddRefs(cv));
     cv->GetIsTabModalPromptAllowed(&allowTabModal);
   }
 
   return allowTabModal;
 }
 
-nsPIDOMEventTarget*
+nsIDOMEventTarget*
 nsGlobalWindow::GetTargetForDOMEvent()
 {
-  return static_cast<nsPIDOMEventTarget*>(GetOuterWindowInternal());
-}
-
-nsPIDOMEventTarget*
+  return static_cast<nsIDOMEventTarget*>(GetOuterWindowInternal());
+}
+
+nsIDOMEventTarget*
 nsGlobalWindow::GetTargetForEventTargetChain()
 {
   return IsInnerWindow() ?
-    this : static_cast<nsPIDOMEventTarget*>(GetCurrentInnerWindowInternal());
+    this : static_cast<nsIDOMEventTarget*>(GetCurrentInnerWindowInternal());
 }
 
 nsresult
 nsGlobalWindow::WillHandleEvent(nsEventChainPostVisitor& aVisitor)
 {
   return NS_OK;
 }
 
@@ -2702,17 +2702,17 @@ nsGlobalWindow::PostHandleEvent(nsEventC
       break;
     default:
       return NS_OK;
   }
 
   /* mChromeEventHandler and mContext go dangling in the middle of this
    function under some circumstances (events that destroy the window)
    without this addref. */
-  nsCOMPtr<nsPIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
+  nsCOMPtr<nsIDOMEventTarget> kungFuDeathGrip1(mChromeEventHandler);
   nsCOMPtr<nsIScriptContext> kungFuDeathGrip2(GetContextInternal());
 
   if (aVisitor.mEvent->message == NS_RESIZE_EVENT) {
     mIsHandlingResizeEvent = PR_FALSE;
   } else if (aVisitor.mEvent->message == NS_PAGE_UNLOAD &&
              NS_IS_TRUSTED_EVENT(aVisitor.mEvent)) {
     // Execute bindingdetached handlers before we tear ourselves
     // down.
@@ -7360,17 +7360,17 @@ nsGlobalWindow::GetListenerManager(PRBoo
     }
 
     static NS_DEFINE_CID(kEventListenerManagerCID,
                          NS_EVENTLISTENERMANAGER_CID);
 
     mListenerManager = do_CreateInstance(kEventListenerManagerCID);
     if (mListenerManager) {
       mListenerManager->SetListenerTarget(
-        static_cast<nsPIDOMEventTarget*>(this));
+        static_cast<nsIDOMEventTarget*>(this));
     }
   }
 
   return mListenerManager;
 }
 
 nsresult
 nsGlobalWindow::GetSystemEventGroup(nsIDOMEventGroup **aGroup)
@@ -7582,17 +7582,17 @@ nsGlobalWindow::DisableDeviceMotionUpdat
       do_GetService(NS_DEVICE_MOTION_CONTRACTID);
     if (ac) {
       ac->RemoveWindowListener(this);
     }
   }
 }
 
 void
-nsGlobalWindow::SetChromeEventHandler(nsPIDOMEventTarget* aChromeEventHandler)
+nsGlobalWindow::SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler)
 {
   SetChromeEventHandlerInternal(aChromeEventHandler);
   if (IsOuterWindow()) {
     // update the chrome event handler on all our inner windows
     for (nsGlobalWindow *inner = (nsGlobalWindow *)PR_LIST_HEAD(this);
          inner != this;
          inner = (nsGlobalWindow*)PR_NEXT_LINK(inner)) {
       NS_ASSERTION(!inner->mOuterWindow || inner->mOuterWindow == this,
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -97,17 +97,17 @@
 #include "mozFlushType.h"
 #include "prclist.h"
 #include "nsIDOMStorageObsolete.h"
 #include "nsIDOMStorageList.h"
 #include "nsIDOMStorageWindow.h"
 #include "nsIDOMStorageEvent.h"
 #include "nsIDOMStorageIndexedDB.h"
 #include "nsIDOMOfflineResourceList.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIArray.h"
 #include "nsIContent.h"
 #include "nsIIDBFactory.h"
 #include "nsFrameMessageManager.h"
 #include "mozilla/TimeStamp.h"
 
 // JS includes
 #include "jsapi.h"
@@ -342,17 +342,17 @@ public:
 
   // nsIDOMWindow_2_0_BRANCH
   NS_DECL_NSIDOMWINDOW_2_0_BRANCH
 
   // nsPIDOMWindow
   virtual NS_HIDDEN_(nsPIDOMWindow*) GetPrivateRoot();
   virtual NS_HIDDEN_(void) ActivateOrDeactivate(PRBool aActivate);
   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_(nsIPrincipal*) GetOpenerScriptPrincipal();
 
   virtual NS_HIDDEN_(PopupControlState) PushPopupControlState(PopupControlState state, PRBool aForce) const;
   virtual NS_HIDDEN_(void) PopPopupControlState(PopupControlState state) const;
   virtual NS_HIDDEN_(PopupControlState) GetPopupControlState() const;
 
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -40,17 +40,17 @@
 #ifndef nsPIDOMWindow_h__
 #define nsPIDOMWindow_h__
 
 #include "nsISupports.h"
 #include "nsIDOMLocation.h"
 #include "nsIDOMXULCommandDispatcher.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMWindowInternal.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIDOMDocument.h"
 #include "nsCOMPtr.h"
 #include "nsEvent.h"
 #include "nsIURI.h"
 
 #define DOM_WINDOW_DESTROYED_TOPIC "dom-window-destroyed"
 #define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
 #define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"
@@ -110,24 +110,24 @@ public:
     mIsBackground = aIsBackground;
   }
 
   PRBool IsBackground()
   {
     return mIsBackground;
   }
 
-  nsPIDOMEventTarget* GetChromeEventHandler() const
+  nsIDOMEventTarget* GetChromeEventHandler() const
   {
     return mChromeEventHandler;
   }
 
-  virtual void SetChromeEventHandler(nsPIDOMEventTarget* aChromeEventHandler) = 0;
+  virtual void SetChromeEventHandler(nsIDOMEventTarget* aChromeEventHandler) = 0;
 
-  nsPIDOMEventTarget* GetParentTarget()
+  nsIDOMEventTarget* GetParentTarget()
   {
     if (!mParentTarget) {
       UpdateParentTarget();
     }
     return mParentTarget;
   }
 
   PRBool HasMutationListeners(PRUint32 aMutationEventType) const
@@ -583,31 +583,31 @@ protected:
   // The nsPIDOMWindow constructor. The aOuterWindow argument should
   // be null if and only if the created window itself is an outer
   // window. In all other cases aOuterWindow should be the outer
   // window for the inner window that is being created.
   nsPIDOMWindow(nsPIDOMWindow *aOuterWindow);
 
   ~nsPIDOMWindow();
 
-  void SetChromeEventHandlerInternal(nsPIDOMEventTarget* aChromeEventHandler) {
+  void SetChromeEventHandlerInternal(nsIDOMEventTarget* aChromeEventHandler) {
     mChromeEventHandler = aChromeEventHandler;
     // mParentTarget will be set when the next event is dispatched.
     mParentTarget = nsnull;
   }
 
   virtual void UpdateParentTarget() = 0;
 
   // 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
   // sure you keep them in sync!
-  nsCOMPtr<nsPIDOMEventTarget> mChromeEventHandler; // strong
+  nsCOMPtr<nsIDOMEventTarget> mChromeEventHandler; // strong
   nsCOMPtr<nsIDOMDocument> mDocument; // strong
 
-  nsCOMPtr<nsPIDOMEventTarget> mParentTarget; // strong
+  nsCOMPtr<nsIDOMEventTarget> mParentTarget; // strong
 
   // These members are only used on outer windows.
   nsCOMPtr<nsIDOMElement> mFrameElement;
   nsIDocShell           *mDocShell;  // Weak Reference
 
   PRUint32               mModalStateDepth;
 
   // These variables are only used on inner windows.
--- a/dom/base/nsPIWindowRoot.h
+++ b/dom/base/nsPIWindowRoot.h
@@ -36,17 +36,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsPIWindowRoot_h__
 #define nsPIWindowRoot_h__
 
 #include "nsISupports.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 
 class nsPIDOMWindow;
 class nsIControllers;
 class nsIController;
 struct JSContext;
 
 // 426C1B56-E38A-435E-B291-BE1557F2A0A2
 #define NS_IWINDOWROOT_IID \
@@ -63,15 +63,15 @@ public:
   // get and set the node that is the context of a popup menu
   virtual nsIDOMNode* GetPopupNode() = 0;
   virtual void SetPopupNode(nsIDOMNode* aNode) = 0;
 
   virtual nsresult GetControllerForCommand(const char *aCommand,
                                            nsIController** aResult) = 0;
   virtual nsresult GetControllers(nsIControllers** aResult) = 0;
 
-  virtual void SetParentTarget(nsPIDOMEventTarget* aTarget) = 0;
-  virtual nsPIDOMEventTarget* GetParentTarget() = 0;
+  virtual void SetParentTarget(nsIDOMEventTarget* aTarget) = 0;
+  virtual nsIDOMEventTarget* GetParentTarget() = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID)
 
 #endif // nsPIWindowRoot_h__
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -100,28 +100,28 @@ nsWindowRoot::RemoveEventListener(const 
   return RemoveGroupedEventListener(aType, aListener, aUseCapture, nsnull);
 }
 
 NS_IMETHODIMP
 nsWindowRoot::DispatchEvent(nsIDOMEvent* aEvt, PRBool *aRetVal)
 {
   nsEventStatus status = nsEventStatus_eIgnore;
   nsresult rv =  nsEventDispatcher::DispatchDOMEvent(
-    static_cast<nsPIDOMEventTarget*>(this), nsnull, aEvt, nsnull, &status);
+    static_cast<nsIDOMEventTarget*>(this), nsnull, aEvt, nsnull, &status);
   *aRetVal = (status != nsEventStatus_eConsumeNoDefault);
   return rv;
 }
 
 nsresult
 nsWindowRoot::DispatchDOMEvent(nsEvent* aEvent,
                                nsIDOMEvent* aDOMEvent,
                                nsPresContext* aPresContext,
                                nsEventStatus* aEventStatus)
 {
-  return nsEventDispatcher::DispatchDOMEvent(static_cast<nsPIDOMEventTarget*>(this),
+  return nsEventDispatcher::DispatchDOMEvent(static_cast<nsIDOMEventTarget*>(this),
                                              aEvent, aDOMEvent,
                                              aPresContext, aEventStatus);
 }
 
 NS_IMETHODIMP
 nsWindowRoot::AddGroupedEventListener(const nsAString & aType, nsIDOMEventListener *aListener, 
                                           PRBool aUseCapture, nsIDOMEventGroup *aEvtGrp)
 {
@@ -203,17 +203,17 @@ nsWindowRoot::GetListenerManager(PRBool 
   if (!mListenerManager) {
     if (!aCreateIfNotFound) {
       return nsnull;
     }
 
     mListenerManager = do_CreateInstance(kEventListenerManagerCID);
     if (mListenerManager) {
       mListenerManager->SetListenerTarget(
-        static_cast<nsPIDOMEventTarget*>(this));
+        static_cast<nsIDOMEventTarget*>(this));
     }
   }
 
   return mListenerManager;
 }
 
 nsresult
 nsWindowRoot::GetSystemEventGroup(nsIDOMEventGroup **aGroup)
@@ -350,16 +350,16 @@ void
 nsWindowRoot::SetPopupNode(nsIDOMNode* aNode)
 {
   mPopupNode = aNode;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////
 
 nsresult
-NS_NewWindowRoot(nsPIDOMWindow* aWindow, nsPIDOMEventTarget** aResult)
+NS_NewWindowRoot(nsPIDOMWindow* aWindow, nsIDOMEventTarget** aResult)
 {
   *aResult = new nsWindowRoot(aWindow);
   if (!*aResult)
     return NS_ERROR_OUT_OF_MEMORY;
   NS_ADDREF(*aResult);
   return NS_OK;
 }
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -71,32 +71,32 @@ public:
 
   virtual nsresult GetControllers(nsIControllers** aResult);
   virtual nsresult GetControllerForCommand(const char * aCommand,
                                            nsIController** _retval);
 
   virtual nsIDOMNode* GetPopupNode();
   virtual void SetPopupNode(nsIDOMNode* aNode);
 
-  virtual void SetParentTarget(nsPIDOMEventTarget* aTarget)
+  virtual void SetParentTarget(nsIDOMEventTarget* aTarget)
   {
     mParent = aTarget;
   }
-  virtual nsPIDOMEventTarget* GetParentTarget() { return mParent; }
+  virtual nsIDOMEventTarget* GetParentTarget() { return mParent; }
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget)
 
 protected:
   // Members
   nsPIDOMWindow* mWindow; // [Weak]. The window will hold on to us and let go when it dies.
   nsCOMPtr<nsIEventListenerManager> mListenerManager; // [Strong]. We own the manager, which owns event listeners attached
                                                       // to us.
 
   nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
 
-  nsCOMPtr<nsPIDOMEventTarget> mParent;
+  nsCOMPtr<nsIDOMEventTarget> mParent;
 };
 
 extern nsresult
 NS_NewWindowRoot(nsPIDOMWindow* aWindow,
-                 nsPIDOMEventTarget** aResult);
+                 nsIDOMEventTarget** aResult);
 
 #endif
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -296,19 +296,19 @@ IDBCursor::~IDBCursor()
   IDBObjectStore::ClearStructuredCloneBuffer(mCloneBuffer);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(IDBCursor)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBCursor)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRequest,
-                                                       nsPIDOMEventTarget)
+                                                       nsIDOMEventTarget)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTransaction,
-                                                       nsPIDOMEventTarget)
+                                                       nsIDOMEventTarget)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mObjectStore)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mIndex)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mScriptContext)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBCursor)
   NS_ASSERTION(tmp->mHaveCachedPrimaryKey ||
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -707,17 +707,17 @@ IDBDatabase::SetVersion(const nsAString&
   // Lock the whole database.
   nsTArray<nsString> storesToOpen;
   nsRefPtr<IDBTransaction> transaction =
     IDBTransaction::Create(this, storesToOpen, IDBTransaction::VERSION_CHANGE,
                            kDefaultDatabaseTimeoutSeconds, true);
   NS_ENSURE_TRUE(transaction, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
 
   nsRefPtr<IDBVersionChangeRequest> request =
-    IDBVersionChangeRequest::Create(static_cast<nsPIDOMEventTarget*>(this),
+    IDBVersionChangeRequest::Create(static_cast<nsIDOMEventTarget*>(this),
                                     ScriptContext(), Owner(), transaction);
   NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
 
   nsRefPtr<SetVersionHelper> helper =
     new SetVersionHelper(transaction, request, aVersion);
 
   IndexedDatabaseManager* mgr = IndexedDatabaseManager::Get();
   NS_ASSERTION(mgr, "This should never be null!");
@@ -961,17 +961,17 @@ SetVersionHelper::GetSuccessResult(JSCon
 {
   DatabaseInfo* info;
   if (!DatabaseInfo::Get(mDatabase->Id(), &info)) {
     NS_ERROR("This should never fail!");
     return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
   }
   info->version = mVersion;
 
-  nsresult rv = WrapNative(aCx, NS_ISUPPORTS_CAST(nsPIDOMEventTarget*,
+  nsresult rv = WrapNative(aCx, NS_ISUPPORTS_CAST(nsIDOMEventTarget*,
                                                   mTransaction),
                            aVal);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 nsresult
--- a/dom/indexedDB/IDBDatabase.h
+++ b/dom/indexedDB/IDBDatabase.h
@@ -75,17 +75,17 @@ public:
                                            nsDOMEventTargetHelper)
 
   static already_AddRefed<IDBDatabase>
   Create(nsIScriptContext* aScriptContext,
          nsPIDOMWindow* aOwner,
          DatabaseInfo* aDatabaseInfo,
          const nsACString& aASCIIOrigin);
 
-  // nsPIDOMEventTarget
+  // nsIDOMEventTarget
   virtual nsresult PostHandleEvent(nsEventChainPostVisitor& aVisitor);
 
   PRUint32 Id()
   {
     return mDatabaseId;
   }
 
   const nsString& Name()
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -1075,11 +1075,11 @@ OpenDatabaseHelper::GetSuccessResult(JSC
 
   nsRefPtr<IDBDatabase> database =
     IDBDatabase::Create(mRequest->ScriptContext(), mRequest->Owner(), dbInfo,
                         mASCIIOrigin);
   if (!database) {
     return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
   }
 
-  return WrapNative(aCx, NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, database),
+  return WrapNative(aCx, NS_ISUPPORTS_CAST(nsIDOMEventTarget*, database),
                     aVal);
 }
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -986,17 +986,17 @@ IDBObjectStore::AddOrPut(const jsval& aV
   request.forget(_retval);
   return NS_OK;
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(IDBObjectStore)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBObjectStore)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mTransaction,
-                                                       nsPIDOMEventTarget)
+                                                       nsIDOMEventTarget)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOwner)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mScriptContext)
 
   for (PRUint32 i = 0; i < tmp->mCreatedIndexes.Length(); i++) {
     NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mCreatedIndexes[i]");
     cb.NoteXPCOMChild(static_cast<nsIIDBIndex*>(tmp->mCreatedIndexes[i].get()));
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
--- a/dom/indexedDB/IDBRequest.h
+++ b/dom/indexedDB/IDBRequest.h
@@ -67,17 +67,17 @@ public:
                                                          nsDOMEventTargetHelper)
 
   static
   already_AddRefed<IDBRequest> Create(nsISupports* aSource,
                                       nsIScriptContext* aScriptContext,
                                       nsPIDOMWindow* aOwner,
                                       IDBTransaction* aTransaction);
 
-  // nsPIDOMEventTarget
+  // nsIDOMEventTarget
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
 
   nsISupports* Source()
   {
     return mSource;
   }
 
   void Reset();
--- a/dom/indexedDB/IDBTransaction.cpp
+++ b/dom/indexedDB/IDBTransaction.cpp
@@ -623,17 +623,17 @@ IDBTransaction::GetOrCreateObjectStore(c
   return retval.forget();
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(IDBTransaction)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBTransaction,
                                                   nsDOMEventTargetHelper)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mDatabase,
-                                                       nsPIDOMEventTarget)
+                                                       nsIDOMEventTarget)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnErrorListener)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnCompleteListener)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnAbortListener)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOnTimeoutListener)
 
   for (PRUint32 i = 0; i < tmp->mCreatedObjectStores.Length(); i++) {
     NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mCreatedObjectStores[i]");
     cb.NoteXPCOMChild(static_cast<nsIIDBObjectStore*>(
--- a/dom/indexedDB/IDBTransaction.h
+++ b/dom/indexedDB/IDBTransaction.h
@@ -84,17 +84,17 @@ public:
 
   static already_AddRefed<IDBTransaction>
   Create(IDBDatabase* aDatabase,
          nsTArray<nsString>& aObjectStoreNames,
          PRUint16 aMode,
          PRUint32 aTimeout,
          bool aDispatchDelayed = false);
 
-  // nsPIDOMEventTarget
+  // nsIDOMEventTarget
   virtual nsresult PreHandleEvent(nsEventChainPreVisitor& aVisitor);
 
   void OnNewRequest();
   void OnRequestFinished();
 
   bool StartSavepoint();
   nsresult ReleaseSavepoint();
   void RollbackSavepoint();
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -753,17 +753,17 @@ TabChild::RecvLoadRemoteScript(const nsS
 bool
 TabChild::RecvAsyncMessage(const nsString& aMessage,
                            const nsString& aJSON)
 {
   if (mTabChildGlobal) {
     nsFrameScriptCx cx(static_cast<nsIWebBrowserChrome*>(this), this);
     nsRefPtr<nsFrameMessageManager> mm =
       static_cast<nsFrameMessageManager*>(mTabChildGlobal->mMessageManager.get());
-    mm->ReceiveMessage(static_cast<nsPIDOMEventTarget*>(mTabChildGlobal),
+    mm->ReceiveMessage(static_cast<nsIDOMEventTarget*>(mTabChildGlobal),
                        aMessage, PR_FALSE, aJSON, nsnull, nsnull);
   }
   return true;
 }
 
 class UnloadScriptEvent : public nsRunnable
 {
 public:
@@ -861,17 +861,17 @@ TabChild::InitTabChildGlobal()
                          nsIXPConnect::FLAG_SYSTEM_GLOBAL_OBJECT;
 
   nsRefPtr<TabChildGlobal> scope = new TabChildGlobal(this);
   NS_ENSURE_TRUE(scope, false);
 
   mTabChildGlobal = scope;
 
   nsISupports* scopeSupports =
-    NS_ISUPPORTS_CAST(nsPIDOMEventTarget*, scope);
+    NS_ISUPPORTS_CAST(nsIDOMEventTarget*, scope);
   JS_SetContextPrivate(cx, scopeSupports);
 
   nsresult rv =
     xpc->InitClassesWithNewWrappedGlobal(cx, scopeSupports,
                                          NS_GET_IID(nsISupports),
                                          scope->GetPrincipal(), nsnull,
                                          flags, getter_AddRefs(mGlobal));
   NS_ENSURE_SUCCESS(rv, false);
--- a/dom/src/events/nsJSEventListener.cpp
+++ b/dom/src/events/nsJSEventListener.cpp
@@ -47,17 +47,17 @@
 #include "nsIPrivateDOMEvent.h"
 #include "nsGUIEvent.h"
 #include "nsContentUtils.h"
 #include "nsDOMScriptObjectHolder.h"
 #include "nsIMutableArray.h"
 #include "nsVariant.h"
 #include "nsIDOMBeforeUnloadEvent.h"
 #include "nsGkAtoms.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIJSContextStack.h"
 #ifdef NS_DEBUG
 #include "nsDOMJSUtils.h"
 
 #include "nspr.h" // PR_fprintf
 
 class EventListenerCounter
 {
@@ -127,17 +127,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsJSEventListener)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsJSEventListener)
 
 nsresult
 nsJSEventListener::GetJSVal(const nsAString& aEventName, jsval* aJSVal)
 {
-  nsCOMPtr<nsPIDOMEventTarget> target = do_QueryInterface(mTarget);
+  nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mTarget);
   if (target && mContext) {
     nsAutoString eventString = NS_LITERAL_STRING("on") + aEventName;
     nsCOMPtr<nsIAtom> atomName = do_GetAtom(eventString);
     nsScriptObjectHolder funcval(mContext);
     nsresult rv = mContext->GetBoundEventHandler(mTarget, mScopeObject,
                                                  atomName, funcval);
     NS_ENSURE_SUCCESS(rv, rv);
     jsval funval =
--- a/editor/libeditor/base/nsEditor.cpp
+++ b/editor/libeditor/base/nsEditor.cpp
@@ -40,17 +40,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "pratom.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMNSEvent.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIMEStateManager.h"
 #include "nsFocusManager.h"
 #include "nsUnicharUtils.h"
 #include "nsReadableUtils.h"
 
 #include "nsIDOMText.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMAttr.h"
@@ -5232,32 +5232,32 @@ nsEditor::GetNativeKeyEvent(nsIDOMKeyEve
   NS_ENSURE_TRUE(nativeEvent, nsnull);
   NS_ENSURE_TRUE(nativeEvent->eventStructType == NS_KEY_EVENT, nsnull);
   return static_cast<nsKeyEvent*>(nativeEvent);
 }
 
 already_AddRefed<nsIContent>
 nsEditor::GetFocusedContent()
 {
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+  nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
   if (!piTarget) {
     return nsnull;
   }
 
   nsFocusManager* fm = nsFocusManager::GetFocusManager();
   NS_ENSURE_TRUE(fm, nsnull);
 
   nsCOMPtr<nsIContent> content = fm->GetFocusedContent();
   return SameCOMIdentity(content, piTarget) ? content.forget() : nsnull;
 }
 
 PRBool
 nsEditor::IsActiveInDOMWindow()
 {
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+  nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
   if (!piTarget) {
     return PR_FALSE;
   }
 
   nsFocusManager* fm = nsFocusManager::GetFocusManager();
   NS_ENSURE_TRUE(fm, PR_FALSE);
 
   nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocWeak);
--- a/editor/libeditor/base/nsEditor.h
+++ b/editor/libeditor/base/nsEditor.h
@@ -57,17 +57,17 @@
 #include "nsCOMArray.h"
 #include "nsIEditActionListener.h"
 #include "nsIEditorObserver.h"
 #include "nsIDocumentStateListener.h"
 #include "nsIDOMElement.h"
 #include "nsSelectionState.h"
 #include "nsIEditorSpellCheck.h"
 #include "nsIInlineSpellChecker.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsStubMutationObserver.h"
 #include "nsIViewManager.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsIDOMCharacterData;
 class nsIDOMRange;
 class nsIPresShell;
 class ChangeAttributeTxn;
@@ -608,17 +608,17 @@ public:
                                     nsISelection *aSelection,
                                     nsIDOMNode *previousSelectedNode,
                                     PRInt32 previousSelectedOffset,
                                     nsIDOMNode *aStartNode,
                                     PRInt32 aStartOffset,
                                     nsIDOMNode *aEndNode,
                                     PRInt32 aEndOffset);
 
-  virtual already_AddRefed<nsPIDOMEventTarget> GetPIDOMEventTarget() = 0;
+  virtual already_AddRefed<nsIDOMEventTarget> GetPIDOMEventTarget() = 0;
 
   // Fast non-refcounting editor root element accessor
   nsIDOMElement *GetRoot();
 
   // Accessor methods to flags
   PRBool IsPlaintextEditor() const
   {
     return (mFlags & nsIPlaintextEditor::eEditorPlaintextMask) != 0;
@@ -759,17 +759,17 @@ protected:
    // various listeners
   nsCOMArray<nsIEditActionListener> mActionListeners;  // listens to all low level actions on the doc
   nsCOMArray<nsIEditorObserver> mEditorObservers;  // just notify once per high level change
   nsCOMArray<nsIDocumentStateListener> mDocStateListeners;// listen to overall doc state (dirty or not, just created, etc)
 
   PRInt8                        mDocDirtyState;		// -1 = not initialized
   nsWeakPtr        mDocWeak;  // weak reference to the nsIDOMDocument
   // The form field as an event receiver
-  nsCOMPtr<nsPIDOMEventTarget> mEventTarget;
+  nsCOMPtr<nsIDOMEventTarget> mEventTarget;
 
   nsString* mPhonetic;
 
  nsCOMPtr<nsIDOMEventListener> mEventListener;
 
   Tristate mLastKeypressEventWasTrusted;
 
   friend PRBool NSCanUnload(nsISupports* serviceMgr);
--- a/editor/libeditor/base/nsEditorEventListener.cpp
+++ b/editor/libeditor/base/nsEditorEventListener.cpp
@@ -39,17 +39,17 @@
  * ***** END LICENSE BLOCK ***** */
 #include "nsEditorEventListener.h"
 #include "nsEditor.h"
 
 #include "nsIDOMDOMStringList.h"
 #include "nsIDOMEvent.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMDocument.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsISelection.h"
 #include "nsISelectionController.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMNSUIEvent.h"
 #include "nsIPrivateTextEvent.h"
@@ -120,17 +120,17 @@ nsEditorEventListener::Connect(nsEditor*
   return rv;
 }
 
 nsresult
 nsEditorEventListener::InstallToEditor()
 {
   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);
 
   nsresult rv;
 
   // register the event listeners with the listener manager
   nsCOMPtr<nsIDOMEventGroup> sysGroup;
   piTarget->GetSystemEventGroup(getter_AddRefs(sysGroup));
   NS_ENSURE_STATE(sysGroup);
@@ -199,17 +199,17 @@ nsEditorEventListener::Disconnect()
   }
   UninstallFromEditor();
   mEditor = nsnull;
 }
 
 void
 nsEditorEventListener::UninstallFromEditor()
 {
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = mEditor->GetPIDOMEventTarget();
+  nsCOMPtr<nsIDOMEventTarget> piTarget = mEditor->GetPIDOMEventTarget();
   if (!piTarget) {
     return;
   }
 
   nsCOMPtr<nsIEventListenerManager> elmP =
     piTarget->GetListenerManager(PR_TRUE);
   if (!elmP) {
     return;
--- a/editor/libeditor/html/nsHTMLAbsPosition.cpp
+++ b/editor/libeditor/html/nsHTMLAbsPosition.cpp
@@ -406,17 +406,17 @@ nsresult
 nsHTMLEditor::GrabberClicked()
 {
   // add a mouse move listener to the editor
   nsresult res = NS_OK;
   if (!mMouseMotionListenerP) {
     mMouseMotionListenerP = new ResizerMouseMotionListener(this);
     if (!mMouseMotionListenerP) {return NS_ERROR_NULL_POINTER;}
 
-    nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+    nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
     NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
 
     res = piTarget->AddEventListenerByIID(mMouseMotionListenerP,
                                           NS_GET_IID(nsIDOMMouseMotionListener));
     NS_ASSERTION(NS_SUCCEEDED(res),
                  "failed to register mouse motion listener");
   }
   mGrabberClicked = PR_TRUE;
@@ -436,17 +436,17 @@ nsHTMLEditor::EndMoving()
 
     nsCOMPtr<nsIContent> parentContent( do_QueryInterface(parentNode) );
     NS_ENSURE_TRUE(parentContent, NS_ERROR_FAILURE);
 
     DeleteRefToAnonymousNode(mPositioningShadow, parentContent, ps);
 
     mPositioningShadow = nsnull;
   }
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+  nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
 
   if (piTarget && mMouseMotionListenerP) {
 #ifdef DEBUG
     nsresult res =
 #endif
     piTarget->RemoveEventListenerByIID(mMouseMotionListenerP,
                                        NS_GET_IID(nsIDOMMouseMotionListener));
     NS_ASSERTION(NS_SUCCEEDED(res), "failed to remove mouse motion listener");
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -468,17 +468,17 @@ nsHTMLEditor::InstallEventListeners()
 void
 nsHTMLEditor::RemoveEventListeners()
 {
   if (!mDocWeak)
   {
     return;
   }
 
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+  nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
   nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget);
 
   if (piTarget && target)
   {
     // Both mMouseMotionListenerP and mResizeEventListenerP can be
     // registerd with other targets than the DOM event receiver that
     // we can reach from here. But nonetheless, unregister the event
     // listeners with the DOM event reveiver (if it's registerd with
@@ -5821,24 +5821,24 @@ nsHTMLEditor::IsActiveInDOMWindow()
   // we're not active).
   if (!content->HasFlag(NODE_IS_EDITABLE) ||
       content->HasIndependentSelection()) {
     return PR_FALSE;
   }
   return PR_TRUE;
 }
 
-already_AddRefed<nsPIDOMEventTarget>
+already_AddRefed<nsIDOMEventTarget>
 nsHTMLEditor::GetPIDOMEventTarget()
 {
   // Don't use getDocument here, because we have no way of knowing
   // whether Init() was ever called.  So we need to get the document
   // ourselves, if it exists.
   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();
 }
 
 PRBool
 nsHTMLEditor::ShouldReplaceRootElement()
 {
   if (!mRootElement) {
     // If we don't know what is our root element, we should find our root.
--- a/editor/libeditor/html/nsHTMLEditor.h
+++ b/editor/libeditor/html/nsHTMLEditor.h
@@ -146,17 +146,17 @@ public:
   virtual  ~nsHTMLEditor();
 
   /* ------------ nsPlaintextEditor overrides -------------- */
   NS_IMETHOD GetIsDocumentEditable(PRBool *aIsDocumentEditable);
   NS_IMETHOD BeginningOfDocument();
   virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent);
   virtual already_AddRefed<nsIContent> GetFocusedContent();
   virtual PRBool IsActiveInDOMWindow();
-  virtual already_AddRefed<nsPIDOMEventTarget> GetPIDOMEventTarget();
+  virtual already_AddRefed<nsIDOMEventTarget> GetPIDOMEventTarget();
   virtual already_AddRefed<nsIContent> FindSelectionRoot(nsINode *aNode);
   virtual PRBool IsAcceptableInputEvent(nsIDOMEvent* aEvent);
 
   /* ------------ nsStubMutationObserver overrides --------- */
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
--- a/editor/libeditor/html/nsHTMLObjectResizer.cpp
+++ b/editor/libeditor/html/nsHTMLObjectResizer.cpp
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsHTMLObjectResizer.h"
 
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMNSHTMLElement.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIDOMText.h"
 
 #include "nsIDOMCSSValue.h"
 #include "nsIDOMCSSPrimitiveValue.h"
 
 #include "nsIContent.h"
 #include "nsIDocument.h"
 #include "nsIDocumentObserver.h"
@@ -492,17 +492,17 @@ nsHTMLEditor::HideResizers(void)
 
   if (mActivatedHandle) {
     mActivatedHandle->RemoveAttribute(NS_LITERAL_STRING("_moz_activated"));
     mActivatedHandle = nsnull;
   }
 
   // don't forget to remove the listeners !
 
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+  nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
   nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget);
 
   if (target && mMouseMotionListenerP)
   {
     res = target->RemoveEventListener(NS_LITERAL_STRING("mousemove"),
                                       mMouseMotionListenerP, PR_TRUE);
     NS_ASSERTION(NS_SUCCEEDED(res), "failed to remove mouse motion listener");
   }
@@ -601,17 +601,17 @@ nsHTMLEditor::StartResizing(nsIDOMElemen
   // add a mouse move listener to the editor
   nsresult result = NS_OK;
   if (!mMouseMotionListenerP) {
     mMouseMotionListenerP = new ResizerMouseMotionListener(this);
     if (!mMouseMotionListenerP) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
-    nsCOMPtr<nsPIDOMEventTarget> piTarget = GetPIDOMEventTarget();
+    nsCOMPtr<nsIDOMEventTarget> piTarget = GetPIDOMEventTarget();
     nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(piTarget);
     NS_ENSURE_TRUE(target, NS_ERROR_FAILURE);
 
     result = target->AddEventListener(NS_LITERAL_STRING("mousemove"),
                                       mMouseMotionListenerP, PR_TRUE);
     NS_ASSERTION(NS_SUCCEEDED(result),
                  "failed to register mouse motion listener");
   }
--- a/editor/libeditor/text/nsPlaintextEditor.cpp
+++ b/editor/libeditor/text/nsPlaintextEditor.cpp
@@ -1710,17 +1710,17 @@ nsPlaintextEditor::SelectEntireDocument(
     NS_ENSURE_SUCCESS(rv, rv);
 
     return aSelection->Extend(parentNode, parentOffset);
   }
 
   return NS_OK;
 }
 
-already_AddRefed<nsPIDOMEventTarget>
+already_AddRefed<nsIDOMEventTarget>
 nsPlaintextEditor::GetPIDOMEventTarget()
 {
   NS_IF_ADDREF(mEventTarget);
   return mEventTarget.get();
 }
 
 
 nsresult
--- a/editor/libeditor/text/nsPlaintextEditor.h
+++ b/editor/libeditor/text/nsPlaintextEditor.h
@@ -140,17 +140,17 @@ public:
    *  with a call to EndOperation */
   NS_IMETHOD EndOperation();
 
   /** make the given selection span the entire document */
   NS_IMETHOD SelectEntireDocument(nsISelection *aSelection);
 
   virtual nsresult HandleKeyPressEvent(nsIDOMKeyEvent* aKeyEvent);
 
-  virtual already_AddRefed<nsPIDOMEventTarget> GetPIDOMEventTarget();
+  virtual already_AddRefed<nsIDOMEventTarget> GetPIDOMEventTarget();
 
   virtual nsresult BeginIMEComposition();
   virtual nsresult UpdateIMEComposition(const nsAString &aCompositionString,
                                         nsIPrivateTextRangeList *aTextRange);
 
   /* ------------ Utility Routines, not part of public API -------------- */
   NS_IMETHOD TypedText(const nsAString& aString, PRInt32 aAction);
 
--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
+++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
@@ -97,42 +97,42 @@
 #include "nsRect.h"
 #include "nsIWebBrowserChromeFocus.h"
 #include "nsIContent.h"
 #include "imgIContainer.h"
 #include "nsContextMenuInfo.h"
 #include "nsPresContext.h"
 #include "nsIViewManager.h"
 #include "nsIView.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIEventListenerManager.h"
 #include "nsIDOMEventGroup.h"
 #include "nsIDOMDragEvent.h"
 #include "nsIConstraintValidation.h"
 
 //
 // GetEventReceiver
 //
 // 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
-GetPIDOMEventTarget( nsWebBrowser* inBrowser, nsPIDOMEventTarget** aTarget)
+GetPIDOMEventTarget( nsWebBrowser* inBrowser, nsIDOMEventTarget** aTarget)
 {
   NS_ENSURE_ARG_POINTER(inBrowser);
   
   nsCOMPtr<nsIDOMWindow> domWindow;
   inBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
   NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsPIDOMWindow> domWindowPrivate = do_QueryInterface(domWindow);
   NS_ENSURE_TRUE(domWindowPrivate, NS_ERROR_FAILURE);
   nsPIDOMWindow *rootWindow = domWindowPrivate->GetPrivateRoot();
   NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE);
-  nsCOMPtr<nsPIDOMEventTarget> piTarget =
+  nsCOMPtr<nsIDOMEventTarget> piTarget =
     do_QueryInterface(rootWindow->GetChromeEventHandler());
   NS_ENSURE_TRUE(piTarget, NS_ERROR_FAILURE);
   *aTarget = piTarget;
   NS_IF_ADDREF(*aTarget);
   
   return NS_OK;
 }
 
@@ -883,17 +883,17 @@ nsDocShellTreeOwner::AddChromeListeners(
         rv = mChromeContextMenuListener->AddChromeListeners();
       }
       else
         rv = NS_ERROR_OUT_OF_MEMORY;
     }
   }
 
   // register dragover and drop event listeners with the listener manager
-  nsCOMPtr<nsPIDOMEventTarget> piTarget;
+  nsCOMPtr<nsIDOMEventTarget> piTarget;
   GetPIDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget));
 
   nsCOMPtr<nsIDOMEventGroup> sysGroup;
   piTarget->GetSystemEventGroup(getter_AddRefs(sysGroup));
   nsIEventListenerManager* elmP = piTarget->GetListenerManager(PR_TRUE);
   if (sysGroup && elmP)
   {
     rv = elmP->AddEventListenerByType(this, NS_LITERAL_STRING("dragover"),
@@ -917,17 +917,17 @@ nsDocShellTreeOwner::RemoveChromeListene
     mChromeTooltipListener->RemoveChromeListeners();
     NS_RELEASE(mChromeTooltipListener);
   }
   if ( mChromeContextMenuListener ) {
     mChromeContextMenuListener->RemoveChromeListeners();
     NS_RELEASE(mChromeContextMenuListener);
   }
 
-  nsCOMPtr<nsPIDOMEventTarget> piTarget;
+  nsCOMPtr<nsIDOMEventTarget> piTarget;
   GetPIDOMEventTarget(mWebBrowser, getter_AddRefs(piTarget));
   if (!piTarget)
     return NS_OK;
 
   nsCOMPtr<nsIDOMEventGroup> sysGroup;
   piTarget->GetSystemEventGroup(getter_AddRefs(sysGroup));
   nsIEventListenerManager* elmP = piTarget->GetListenerManager(PR_TRUE);
   if (sysGroup && elmP)
--- a/embedding/browser/webBrowser/nsDocShellTreeOwner.h
+++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.h
@@ -61,17 +61,17 @@
 #include "nsIDOMContextMenuListener.h"
 #include "nsITimer.h"
 #include "nsIPrompt.h"
 #include "nsIAuthPrompt.h"
 #include "nsITooltipListener.h"
 #include "nsITooltipTextProvider.h"
 #include "nsCTooltipTextProvider.h"
 #include "nsIDroppedLinkHandler.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsCommandHandler.h"
 
 class nsWebBrowser;
 class ChromeTooltipListener;
 class ChromeContextMenuListener;
 
 // {6D10C180-6888-11d4-952B-0020183BF181}
 #define NS_ICDOCSHELLTREEOWNER_IID \
@@ -220,17 +220,17 @@ private:
 
   NS_IMETHOD AddTooltipListener();
   NS_IMETHOD RemoveTooltipListener();
 
   NS_IMETHOD ShowTooltip ( PRInt32 inXCoords, PRInt32 inYCoords, const nsAString & inTipText ) ;
   NS_IMETHOD HideTooltip ( ) ;
 
   nsWebBrowser* mWebBrowser;
-  nsCOMPtr<nsPIDOMEventTarget> mEventTarget;
+  nsCOMPtr<nsIDOMEventTarget> 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
     // to tell it, and no one would ever tell us of that fact.
   nsCOMPtr<nsIWebBrowserChrome> mWebBrowserChrome;
 
@@ -287,17 +287,17 @@ public:
 private:
 
   NS_IMETHOD AddContextMenuListener();
   NS_IMETHOD RemoveContextMenuListener();
 
   PRPackedBool mContextMenuListenerInstalled;
 
   nsWebBrowser* mWebBrowser;
-  nsCOMPtr<nsPIDOMEventTarget> mEventTarget;
+  nsCOMPtr<nsIDOMEventTarget> mEventTarget;
   nsCOMPtr<nsIWebBrowserChrome> mWebBrowserChrome;
 
 }; // class ChromeContextMenuListener
 
 
 
 #endif /* nsDocShellTreeOwner_h__ */
 
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -68,17 +68,17 @@
 #include "mozInlineSpellWordUtil.h"
 #include "mozISpellI18NManager.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventTarget.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMNode.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMNSRange.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMText.h"
 #include "nsIPlaintextEditor.h"
@@ -640,17 +640,17 @@ mozInlineSpellChecker::RegisterEventList
   NS_ENSURE_TRUE(editor, NS_ERROR_NULL_POINTER);
 
   editor->AddEditActionListener(this);
 
   nsCOMPtr<nsIDOMDocument> doc;
   nsresult rv = editor->GetDocument(getter_AddRefs(doc));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<nsPIDOMEventTarget> piTarget = do_QueryInterface(doc, &rv);
+  nsCOMPtr<nsIDOMEventTarget> piTarget = do_QueryInterface(doc, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsIEventListenerManager* elmP = piTarget->GetListenerManager(PR_TRUE);
   if (elmP) {
     // Focus event doesn't bubble so adding the listener to capturing phase
     elmP->AddEventListenerByIID(static_cast<nsIDOMFocusListener *>(this),
                                 NS_GET_IID(nsIDOMFocusListener),
                                 NS_EVENT_FLAG_CAPTURE);
@@ -673,17 +673,17 @@ mozInlineSpellChecker::UnregisterEventLi
   NS_ENSURE_TRUE(editor, NS_ERROR_NULL_POINTER);
 
   editor->RemoveEditActionListener(this);
 
   nsCOMPtr<nsIDOMDocument> doc;
   editor->GetDocument(getter_AddRefs(doc));
   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);
 
   nsCOMPtr<nsIEventListenerManager> elmP =
     piTarget->GetListenerManager(PR_TRUE);
   if (elmP) {
     elmP->RemoveEventListenerByIID(static_cast<nsIDOMFocusListener *>(this),
                                    NS_GET_IID(nsIDOMFocusListener),
                                    NS_EVENT_FLAG_CAPTURE);
--- a/extensions/widgetutils/src/nsWidgetUtils.cpp
+++ b/extensions/widgetutils/src/nsWidgetUtils.cpp
@@ -440,17 +440,17 @@ nsWidgetUtils::GetDOMWindowByNode(nsIDOM
   return rv;
 }
 
 void
 nsWidgetUtils::GetChromeEventHandler(nsIDOMWindow *aDOMWin,
                                      nsIDOMEventTarget **aChromeTarget)
 {
     nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin));
-    nsPIDOMEventTarget* chromeEventHandler = nsnull;
+    nsIDOMEventTarget* chromeEventHandler = nsnull;
     if (privateDOMWindow) {
         chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
     }
 
     nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));
 
     *aChromeTarget = target;
     NS_IF_ADDREF(*aChromeTarget);
@@ -462,17 +462,17 @@ nsWidgetUtils::RemoveWindowListeners(nsI
     nsresult rv;
     nsCOMPtr<nsIDOMEventTarget> chromeEventHandler;
     GetChromeEventHandler(aDOMWin, getter_AddRefs(chromeEventHandler));
     if (!chromeEventHandler) {
         return;
     }
 
     // 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
     rv = piTarget->RemoveEventListenerByIID(static_cast<nsIDOMMouseListener*>(this),
                                             NS_GET_IID(nsIDOMMouseListener));
     if (NS_FAILED(rv)) {
         NS_WARNING("Failed to add Mouse Motion listener\n");
         return;
     }
@@ -490,17 +490,17 @@ nsWidgetUtils::AttachWindowListeners(nsI
     nsresult rv;
     nsCOMPtr<nsIDOMEventTarget> chromeEventHandler;
     GetChromeEventHandler(aDOMWin, getter_AddRefs(chromeEventHandler));
     if (!chromeEventHandler) {
         return;
     }
 
     // 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
     rv = piTarget->AddEventListenerByIID(static_cast<nsIDOMMouseListener*>(this),
                                          NS_GET_IID(nsIDOMMouseListener));
     if (NS_FAILED(rv)) {
         NS_WARNING("Failed to add Mouse Motion listener\n");
         return;
     }
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1706,17 +1706,17 @@ nsPresContext::MediaFeatureValuesChanged
     for (PRCList *l = PR_LIST_HEAD(&mDOMMediaQueryLists);
          l != &mDOMMediaQueryLists; l = PR_NEXT_LINK(l)) {
       nsDOMMediaQueryList *mql = static_cast<nsDOMMediaQueryList*>(l);
       mql->MediumFeaturesChanged(notifyList);
     }
 
     if (!notifyList.IsEmpty()) {
       nsPIDOMWindow *win = mDocument->GetInnerWindow();
-      nsCOMPtr<nsPIDOMEventTarget> et = do_QueryInterface(win);
+      nsCOMPtr<nsIDOMEventTarget> et = do_QueryInterface(win);
       nsCxPusher pusher;
 
       for (PRUint32 i = 0, i_end = notifyList.Length(); i != i_end; ++i) {
         if (pusher.RePush(et)) {
           nsDOMMediaQueryList::HandleChangeData &d = notifyList[i];
           d.listener->HandleChange(d.mql);
         }
       }
@@ -2061,17 +2061,17 @@ nsPresContext::FireDOMPaintEvent()
 static PRBool
 MayHavePaintEventListener(nsPIDOMWindow* aInnerWindow)
 {
   if (!aInnerWindow)
     return PR_FALSE;
   if (aInnerWindow->HasPaintEventListeners())
     return PR_TRUE;
 
-  nsPIDOMEventTarget* parentTarget = aInnerWindow->GetParentTarget();
+  nsIDOMEventTarget* parentTarget = aInnerWindow->GetParentTarget();
   if (!parentTarget)
     return PR_FALSE;
 
   nsIEventListenerManager* manager = nsnull;
   if ((manager = parentTarget->GetListenerManager(PR_FALSE)) &&
       manager->MayHavePaintEventListener()) {
     return PR_TRUE;
   }
@@ -2091,17 +2091,17 @@ MayHavePaintEventListener(nsPIDOMWindow*
   if (node)
     return MayHavePaintEventListener(node->GetOwnerDoc()->GetInnerWindow());
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(parentTarget);
   if (window)
     return MayHavePaintEventListener(window);
 
   nsCOMPtr<nsPIWindowRoot> root = do_QueryInterface(parentTarget);
-  nsPIDOMEventTarget* tabChildGlobal;
+  nsIDOMEventTarget* tabChildGlobal;
   return root &&
          (tabChildGlobal = root->GetParentTarget()) &&
          (manager = tabChildGlobal->GetListenerManager(PR_FALSE)) &&
          manager->MayHavePaintEventListener();
 }
 
 PRBool
 nsPresContext::MayHavePaintEventListener()
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -1118,17 +1118,17 @@ nsFormFillController::ContextMenu(nsIDOM
 
 void
 nsFormFillController::AddWindowListeners(nsIDOMWindow *aWindow)
 {
   if (!aWindow)
     return;
 
   nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow));
-  nsPIDOMEventTarget* chromeEventHandler = nsnull;
+  nsIDOMEventTarget* chromeEventHandler = nsnull;
   if (privateDOMWindow)
     chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
 
   nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));
 
   if (!target)
     return;
 
@@ -1180,17 +1180,17 @@ nsFormFillController::RemoveWindowListen
 
   StopControllingInput();
   
   nsCOMPtr<nsIDOMDocument> domDoc;
   aWindow->GetDocument(getter_AddRefs(domDoc));
   mPwmgrInputs.Enumerate(RemoveForDOMDocumentEnumerator, domDoc);
 
   nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aWindow));
-  nsPIDOMEventTarget* chromeEventHandler = nsnull;
+  nsIDOMEventTarget* chromeEventHandler = nsnull;
   if (privateDOMWindow)
     chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
   
   nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));
 
   if (!target)
     return;
 
--- a/widget/public/nsGUIEvent.h
+++ b/widget/public/nsGUIEvent.h
@@ -47,17 +47,17 @@
 #include "nsRegion.h"
 #include "nsEvent.h"
 #include "nsStringGlue.h"
 #include "nsCOMPtr.h"
 #include "nsIAtom.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMNSMouseEvent.h"
 #include "nsIDOMDataTransfer.h"
-#include "nsPIDOMEventTarget.h"
+#include "nsIDOMEventTarget.h"
 #include "nsWeakPtr.h"
 #include "nsIWidget.h"
 #include "nsTArray.h"
 #include "nsTraceRefcnt.h"
 #include "nsITransferable.h"
 #include "nsIVariant.h"
 #include "nsStyleConsts.h"
 
@@ -597,19 +597,19 @@ public:
   // to the time the message was created
   PRUint64    time;
   // Flags to hold event flow stage and capture/bubble cancellation
   // status. This is used also to indicate whether the event is trusted.
   PRUint32    flags;
   // Additional type info for user defined events
   nsCOMPtr<nsIAtom>     userType;
   // Event targets, needed by DOM Events
-  nsCOMPtr<nsPIDOMEventTarget> target;
-  nsCOMPtr<nsPIDOMEventTarget> currentTarget;
-  nsCOMPtr<nsPIDOMEventTarget> originalTarget;
+  nsCOMPtr<nsIDOMEventTarget> target;
+  nsCOMPtr<nsIDOMEventTarget> currentTarget;
+  nsCOMPtr<nsIDOMEventTarget> originalTarget;
 };
 
 /**
  * General graphic user interface event
  */
 
 class nsGUIEvent : public nsEvent
 {
--- a/xpfe/appshell/src/nsWebShellWindow.cpp
+++ b/xpfe/appshell/src/nsWebShellWindow.cpp
@@ -739,17 +739,17 @@ PRBool nsWebShellWindow::ExecuteCloseHan
   /* If the event handler closes this window -- a likely scenario --
      things get deleted out of order without this death grip.
      (The problem may be the death grip in nsWindow::windowProc,
      which forces this window's widget to remain alive longer
      than it otherwise would.) */
   nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this);
 
   nsCOMPtr<nsPIDOMWindow> window(do_GetInterface(mDocShell));
-  nsCOMPtr<nsPIDOMEventTarget> eventTarget = do_QueryInterface(window);
+  nsCOMPtr<nsIDOMEventTarget> eventTarget = do_QueryInterface(window);
 
   if (eventTarget) {
     nsCOMPtr<nsIContentViewer> contentViewer;
     mDocShell->GetContentViewer(getter_AddRefs(contentViewer));
     nsCOMPtr<nsIDocumentViewer> docViewer(do_QueryInterface(contentViewer));
 
     if (docViewer) {
       nsRefPtr<nsPresContext> presContext;