Bug 1463015: Part 2 - Convert existing mozIDOMWindow(|Outer) users to nsPIDOMWindow(Inner|Outer). r?nika draft
authorKris Maglione <maglione.k@gmail.com>
Sun, 20 May 2018 14:38:10 -0700
changeset 797546 3a780c628a2f4df31094b86e323e414d777e52d6
parent 797545 94d227e7222e6a8e971955a25cf4ee562ee001bf
child 797547 c0b936e8ce0ecbf34244255ced8762c38f545924
push id110512
push usermaglione.k@gmail.com
push dateSun, 20 May 2018 22:52:08 +0000
reviewersnika
bugs1463015
milestone62.0a1
Bug 1463015: Part 2 - Convert existing mozIDOMWindow(|Outer) users to nsPIDOMWindow(Inner|Outer). r?nika MozReview-Commit-ID: 3ePWbdKMvUe
accessible/base/DocManager.cpp
accessible/base/Logging.cpp
accessible/interfaces/nsIAccessibleDocument.idl
accessible/xpcom/xpcAccessibleDocument.cpp
accessible/xpcom/xpcAccessibleDocument.h
browser/modules/SiteDataManager.jsm
chrome/nsChromeRegistry.cpp
docshell/base/LoadContext.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/nsDocShellTreeOwner.cpp
docshell/base/nsILoadContext.idl
dom/audiochannel/AudioChannelAgent.cpp
dom/audiochannel/nsIAudioChannelAgent.idl
dom/base/DOMRequest.cpp
dom/base/TabGroup.cpp
dom/base/TabGroup.h
dom/base/TextInputProcessor.cpp
dom/base/TextInputProcessor.h
dom/base/ThirdPartyUtil.cpp
dom/base/nsContentPermissionHelper.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDOMWindowList.cpp
dom/base/nsDocument.cpp
dom/base/nsFocusManager.cpp
dom/base/nsGlobalWindowOuter.cpp
dom/base/nsIDOMRequestService.idl
dom/base/nsObjectLoadingContent.cpp
dom/base/nsObjectLoadingContent.h
dom/base/nsWindowMemoryReporter.cpp
dom/base/test/chrome/test_bug1339722.html
dom/browser-element/BrowserElementParent.cpp
dom/browser-element/BrowserElementParent.h
dom/clients/manager/ClientOpenWindowUtils.cpp
dom/commandhandler/nsCommandManager.cpp
dom/commandhandler/nsCommandManager.h
dom/commandhandler/nsICommandManager.idl
dom/commandhandler/nsPICommandUpdater.idl
dom/credentialmanagement/CredentialsContainer.cpp
dom/events/EventStateManager.cpp
dom/geolocation/nsGeolocation.cpp
dom/html/nsGenericHTMLElement.cpp
dom/html/nsGenericHTMLFrameElement.cpp
dom/html/nsGenericHTMLFrameElement.h
dom/html/nsIFormSubmitObserver.idl
dom/interfaces/base/nsIBrowserDOMWindow.idl
dom/interfaces/base/nsIContentPermissionPrompt.idl
dom/interfaces/base/nsIDOMChromeWindow.idl
dom/interfaces/base/nsIDOMGlobalPropertyInitializer.idl
dom/interfaces/base/nsIDOMWindowCollection.idl
dom/interfaces/base/nsIFocusManager.idl
dom/interfaces/base/nsIServiceWorkerManager.idl
dom/interfaces/base/nsITextInputProcessor.idl
dom/interfaces/storage/nsIDOMStorageManager.idl
dom/interfaces/xul/nsIDOMXULCommandDispatcher.idl
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/FilePickerParent.cpp
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/media/webrtc/MediaEngineTabVideoSource.cpp
dom/media/webrtc/nsITabSource.idl
dom/media/webvtt/nsIWebVTTParserWrapper.idl
dom/midi/MIDIPermissionRequest.cpp
dom/notification/Notification.cpp
dom/plugins/ipc/PluginHangUIParent.cpp
dom/power/PowerManagerService.cpp
dom/power/nsIPowerManagerService.idl
dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl
dom/presentation/ipc/PresentationBuilderParent.cpp
dom/quota/StorageManager.cpp
dom/storage/LocalStorageManager.cpp
dom/storage/LocalStorageManager.h
dom/storage/SessionStorageManager.cpp
dom/workers/WorkerDebugger.cpp
dom/workers/nsIWorkerDebugger.idl
dom/xbl/nsXBLWindowKeyHandler.cpp
dom/xul/nsXULCommandDispatcher.cpp
dom/xul/nsXULElement.cpp
dom/xul/nsXULElement.h
editor/composer/nsEditingSession.cpp
editor/composer/nsEditingSession.h
editor/composer/nsIEditingSession.idl
editor/libeditor/HTMLEditor.cpp
editor/nsIEditorUtils.idl
extensions/cookie/nsPermissionManager.cpp
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/wrappers/AccessCheck.cpp
layout/base/PresShell.cpp
layout/base/nsDocumentViewer.cpp
layout/printing/nsIPrintProgress.idl
layout/printing/nsPrintJob.cpp
layout/printing/nsPrintJob.h
layout/tools/layout-debug/src/nsILayoutDebuggingTools.idl
layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
layout/xul/nsXULPopupManager.cpp
netwerk/base/mozIThirdPartyUtil.idl
netwerk/base/nsChannelClassifier.cpp
netwerk/base/nsIPermissionManager.idl
netwerk/base/nsISecureBrowserUI.idl
netwerk/protocol/http/HttpBaseChannel.cpp
security/manager/pki/nsNSSDialogHelper.cpp
security/manager/pki/nsNSSDialogHelper.h
security/manager/pki/nsNSSDialogs.cpp
security/manager/ssl/nsSecureBrowserUIImpl.cpp
toolkit/components/alerts/nsXULAlerts.cpp
toolkit/components/alerts/nsXULAlerts.h
toolkit/components/browser/nsIPrintingPromptService.idl
toolkit/components/browser/nsIWebBrowser.idl
toolkit/components/browser/nsIWebBrowserFocus.idl
toolkit/components/browser/nsIWebBrowserPrint.idl
toolkit/components/browser/nsWebBrowser.cpp
toolkit/components/extensions/mozIExtensionProcessScript.idl
toolkit/components/find/nsIWebBrowserFind.idl
toolkit/components/find/nsWebBrowserFind.cpp
toolkit/components/printingui/ipc/PrintDataUtils.cpp
toolkit/components/printingui/ipc/nsPrintingProxy.cpp
toolkit/components/printingui/nsPrintProgress.cpp
toolkit/components/printingui/nsPrintingPromptService.cpp
toolkit/components/remote/nsDBusRemoteService.cpp
toolkit/components/remote/nsGTKRemoteService.cpp
toolkit/components/remote/nsIRemoteService.idl
toolkit/components/remote/nsRemoteService.cpp
toolkit/components/sessionstore/nsISessionStoreUtils.idl
toolkit/components/sessionstore/nsSessionStoreUtils.cpp
toolkit/components/startup/nsAppStartup.cpp
toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
toolkit/components/typeaheadfind/nsITypeAheadFind.idl
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
toolkit/components/windowcreator/nsIWindowCreator2.idl
toolkit/components/windowcreator/nsIWindowProvider.idl
toolkit/components/windowwatcher/nsIPromptFactory.idl
toolkit/components/windowwatcher/nsIPromptService.idl
toolkit/components/windowwatcher/nsIWindowWatcher.idl
toolkit/components/windowwatcher/nsPIWindowWatcher.idl
toolkit/components/windowwatcher/nsWindowWatcher.cpp
toolkit/components/windowwatcher/nsWindowWatcher.h
toolkit/modules/sessionstore/Utils.jsm
toolkit/xre/ProfileReset.cpp
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsNativeAppSupportCocoa.mm
toolkit/xre/nsNativeAppSupportWin.cpp
uriloader/base/nsDocLoader.cpp
uriloader/base/nsIWebProgress.idl
uriloader/prefetch/OfflineCacheUpdateParent.cpp
uriloader/prefetch/nsIOfflineCacheUpdate.idl
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
widget/android/AndroidBridge.cpp
widget/android/AndroidBridge.h
widget/android/fennec/ThumbnailHelper.h
widget/android/nsIAndroidBridge.idl
widget/android/nsWindow.cpp
widget/cocoa/nsColorPicker.h
widget/cocoa/nsColorPicker.mm
widget/gtk/TaskbarProgress.cpp
widget/gtk/nsApplicationChooser.cpp
widget/gtk/nsColorPicker.cpp
widget/nsBaseFilePicker.cpp
widget/nsBaseFilePicker.h
widget/nsColorPickerProxy.cpp
widget/nsFilePickerProxy.cpp
widget/nsFilePickerProxy.h
widget/nsIApplicationChooser.idl
widget/nsIColorPicker.idl
widget/nsIFilePicker.idl
widget/nsIGtkTaskbarProgress.idl
widget/nsIWinTaskbar.idl
widget/windows/WinTaskbar.cpp
widget/windows/nsColorPicker.cpp
widget/windows/nsColorPicker.h
widget/windows/nsFilePicker.cpp
widget/windows/nsFilePicker.h
widget/windows/nsPrintDialogWin.cpp
widget/windows/nsPrintDialogWin.h
xpcom/base/nsIMemoryReporter.idl
xpcom/base/nsMemoryReporterManager.cpp
xpcom/io/nsLocalFileWin.cpp
xpfe/appshell/nsAppShellService.cpp
xpfe/appshell/nsAppShellService.h
xpfe/appshell/nsContentTreeOwner.cpp
xpfe/appshell/nsIAppShellService.idl
xpfe/appshell/nsIWindowMediator.idl
xpfe/appshell/nsIXULBrowserWindow.idl
xpfe/appshell/nsIXULWindow.idl
xpfe/appshell/nsWebShellWindow.cpp
xpfe/appshell/nsWebShellWindow.h
xpfe/appshell/nsWindowMediator.cpp
xpfe/appshell/nsXULWindow.cpp
xpfe/appshell/nsXULWindow.h
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -237,17 +237,17 @@ DocManager::OnStateChange(nsIWebProgress
                           nsresult aStatus)
 {
   NS_ASSERTION(aStateFlags & STATE_IS_DOCUMENT, "Other notifications excluded");
 
   if (nsAccessibilityService::IsShutdown() || !aWebProgress ||
       (aStateFlags & (STATE_START | STATE_STOP)) == 0)
     return NS_OK;
 
-  nsCOMPtr<mozIDOMWindowProxy> DOMWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> DOMWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
   NS_ENSURE_STATE(DOMWindow);
 
   nsPIDOMWindowOuter* piWindow = nsPIDOMWindowOuter::From(DOMWindow);
   MOZ_ASSERT(piWindow);
 
   nsCOMPtr<nsIDocument> document = piWindow->GetDoc();
   NS_ENSURE_STATE(document);
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -395,17 +395,17 @@ static const char* sDocEventTitle = "DOC
 static const char* sFocusTitle = "FOCUS";
 
 void
 logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
                  nsIRequest* aRequest, uint32_t aStateFlags)
 {
   MsgBegin(sDocLoadTitle, "%s", aMsg);
 
-  nsCOMPtr<mozIDOMWindowProxy> DOMWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> DOMWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
   nsPIDOMWindowOuter* window = nsPIDOMWindowOuter::From(DOMWindow);
   if (!window) {
     MsgEnd();
     return;
   }
 
   nsCOMPtr<nsIDocument> documentNode = window->GetDoc();
--- a/accessible/interfaces/nsIAccessibleDocument.idl
+++ b/accessible/interfaces/nsIAccessibleDocument.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIAccessiblePivot;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 webidl Document;
 
 /**
  * An interface for in-process accessibility clients
  * that wish to retrieve information about a document.
  * When accessibility is turned on in Gecko,
  * there is an nsIAccessibleDocument for each document
@@ -46,17 +46,17 @@ interface nsIAccessibleDocument : nsISup
   /**
    * The Document interface associated with this document.
    */
   readonly attribute Document DOMDocument;
 
   /**
    * The nsIDOMWindow that the document resides in.
    */
-  readonly attribute mozIDOMWindowProxy window;
+  readonly attribute WindowProxy window;
 
   /**
    * Return the parent document accessible.
    */
   readonly attribute nsIAccessibleDocument parentDocument;
 
   /**
    * Return the count of child document accessibles.
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -95,17 +95,17 @@ xpcAccessibleDocument::GetDOMDocument(ns
 
   if (Intl()->DocumentNode())
     NS_ADDREF(*aDOMDocument = Intl()->DocumentNode());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-xpcAccessibleDocument::GetWindow(mozIDOMWindowProxy** aDOMWindow)
+xpcAccessibleDocument::GetWindow(nsPIDOMWindowOuter** aDOMWindow)
 {
   NS_ENSURE_ARG_POINTER(aDOMWindow);
   *aDOMWindow = nullptr;
 
   if (!Intl())
     return NS_ERROR_FAILURE;
 
   NS_IF_ADDREF(*aDOMWindow = Intl()->DocumentNode()->GetWindow());
--- a/accessible/xpcom/xpcAccessibleDocument.h
+++ b/accessible/xpcom/xpcAccessibleDocument.h
@@ -34,17 +34,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleDocument
   NS_IMETHOD GetURL(nsAString& aURL) final;
   NS_IMETHOD GetTitle(nsAString& aTitle) final;
   NS_IMETHOD GetMimeType(nsAString& aType) final;
   NS_IMETHOD GetDocType(nsAString& aType) final;
   NS_IMETHOD GetDOMDocument(nsIDocument** aDOMDocument) final;
-  NS_IMETHOD GetWindow(mozIDOMWindowProxy** aDOMWindow) final;
+  NS_IMETHOD GetWindow(nsPIDOMWindowOuter** aDOMWindow) final;
   NS_IMETHOD GetParentDocument(nsIAccessibleDocument** aDocument)
     final;
   NS_IMETHOD GetChildDocumentCount(uint32_t* aCount) final;
   NS_IMETHOD GetChildDocumentAt(uint32_t aIndex,
                                 nsIAccessibleDocument** aDocument)
     final;
   NS_IMETHOD GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor)
     final;
--- a/browser/modules/SiteDataManager.jsm
+++ b/browser/modules/SiteDataManager.jsm
@@ -366,17 +366,17 @@ var SiteDataManager = {
     return this.updateSites();
   },
 
   /**
    * In the specified window, shows a prompt for removing
    * all site data or the specified list of hosts, warning the
    * user that this may log them out of websites.
    *
-   * @param {mozIDOMWindowProxy} a parent DOM window to host the dialog.
+   * @param {Window} a parent DOM window to host the dialog.
    * @param {Array} [optional] an array of host name strings that will be removed.
    * @returns a boolean whether the user confirmed the prompt.
    */
   promptSiteDataRemoval(win, removals) {
     if (removals) {
       let args = {
         hosts: removals,
         allowed: false
--- a/chrome/nsChromeRegistry.cpp
+++ b/chrome/nsChromeRegistry.cpp
@@ -381,17 +381,17 @@ nsChromeRegistry::FlushSkinCaches()
 nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindowOuter* aWindow)
 {
   // Deal with our subframes first.
   nsCOMPtr<nsIDOMWindowCollection> frames = aWindow->GetFrames();
   uint32_t length;
   frames->GetLength(&length);
   uint32_t j;
   for (j = 0; j < length; j++) {
-    nsCOMPtr<mozIDOMWindowProxy> childWin;
+    nsCOMPtr<nsPIDOMWindowOuter> childWin;
     frames->Item(j, getter_AddRefs(childWin));
     nsCOMPtr<nsPIDOMWindowOuter> piWindow = nsPIDOMWindowOuter::From(childWin);
     RefreshWindow(piWindow);
   }
 
   nsresult rv;
   // Get the document.
   nsCOMPtr<nsIDocument> document = aWindow->GetDoc();
--- a/docshell/base/LoadContext.cpp
+++ b/docshell/base/LoadContext.cpp
@@ -38,26 +38,26 @@ LoadContext::LoadContext(nsIPrincipal* a
   MOZ_ALWAYS_SUCCEEDS(aOptionalBase->GetUseTrackingProtection(&mUseTrackingProtection));
 }
 
 //-----------------------------------------------------------------------------
 // LoadContext::nsILoadContext
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-LoadContext::GetAssociatedWindow(mozIDOMWindowProxy**)
+LoadContext::GetAssociatedWindow(nsPIDOMWindowOuter**)
 {
   MOZ_ASSERT(mIsNotNull);
 
   // can't support this in the parent process
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
-LoadContext::GetTopWindow(mozIDOMWindowProxy**)
+LoadContext::GetTopWindow(nsPIDOMWindowOuter**)
 {
   MOZ_ASSERT(mIsNotNull);
 
   // can't support this in the parent process
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -3257,17 +3257,17 @@ nsDocShell::CanAccessItem(nsIDocShellTre
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> targetWindow = aTargetItem->GetWindow();
   if (!targetWindow) {
     NS_ERROR("This should not happen, really");
     return false;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> targetOpener = targetWindow->GetOpener();
+  nsCOMPtr<nsPIDOMWindowOuter> targetOpener = targetWindow->GetOpener();
   nsCOMPtr<nsIWebNavigation> openerWebNav(do_GetInterface(targetOpener));
   nsCOMPtr<nsIDocShellTreeItem> openerItem(do_QueryInterface(openerWebNav));
 
   if (!openerItem) {
     return false;
   }
 
   return CanAccessItem(openerItem, aAccessingItem, false);
@@ -12991,24 +12991,24 @@ nsDocShell::GetAuthPrompt(uint32_t aProm
                            reinterpret_cast<void**>(aResult));
 }
 
 //*****************************************************************************
 // nsDocShell::nsILoadContext
 //*****************************************************************************
 
 NS_IMETHODIMP
-nsDocShell::GetAssociatedWindow(mozIDOMWindowProxy** aWindow)
+nsDocShell::GetAssociatedWindow(nsPIDOMWindowOuter** aWindow)
 {
   CallGetInterface(this, aWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDocShell::GetTopWindow(mozIDOMWindowProxy** aWindow)
+nsDocShell::GetTopWindow(nsPIDOMWindowOuter** aWindow)
 {
   nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
   if (win) {
     win = win->GetTop();
   }
   win.forget(aWindow);
   return NS_OK;
 }
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -227,18 +227,18 @@ public:
                              nsIPrincipal* aTriggeringPrincipal = nullptr) override;
   NS_IMETHOD OnOverLink(nsIContent* aContent,
                         nsIURI* aURI,
                         const char16_t* aTargetSpec) override;
   NS_IMETHOD OnLeaveLink() override;
 
   // Don't use NS_DECL_NSILOADCONTEXT because some of nsILoadContext's methods
   // are shared with nsIDocShell (appID, etc.) and can't be declared twice.
-  NS_IMETHOD GetAssociatedWindow(mozIDOMWindowProxy**) override;
-  NS_IMETHOD GetTopWindow(mozIDOMWindowProxy**) override;
+  NS_IMETHOD GetAssociatedWindow(nsPIDOMWindowOuter**) override;
+  NS_IMETHOD GetTopWindow(nsPIDOMWindowOuter**) override;
   NS_IMETHOD GetTopFrameElement(mozilla::dom::Element**) override;
   NS_IMETHOD GetNestedFrameId(uint64_t*) override;
   NS_IMETHOD GetIsContent(bool*) override;
   NS_IMETHOD GetUsePrivateBrowsing(bool*) override;
   NS_IMETHOD SetUsePrivateBrowsing(bool) override;
   NS_IMETHOD SetPrivateBrowsing(bool) override;
   NS_IMETHOD GetUseRemoteTabs(bool*) override;
   NS_IMETHOD SetRemoteTabs(bool) override;
--- a/docshell/base/nsDocShellTreeOwner.cpp
+++ b/docshell/base/nsDocShellTreeOwner.cpp
@@ -66,17 +66,17 @@ using namespace mozilla::dom;
 // a |EventTarget| via the window root and chrome event handler.
 static nsresult
 GetDOMEventTarget(nsWebBrowser* aInBrowser, EventTarget** aTarget)
 {
   if (!aInBrowser) {
     return NS_ERROR_INVALID_POINTER;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   aInBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
   if (!domWindow) {
     return NS_ERROR_FAILURE;
   }
 
   auto* outerWindow = nsPIDOMWindowOuter::From(domWindow);
   nsPIDOMWindowOuter* rootWindow = outerWindow->GetPrivateRoot();
   NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE);
@@ -174,46 +174,46 @@ void
 nsDocShellTreeOwner::EnsurePrompter()
 {
   if (mPrompter) {
     return;
   }
 
   nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
   if (wwatch && mWebBrowser) {
-    nsCOMPtr<mozIDOMWindowProxy> domWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow;
     mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
     if (domWindow) {
       wwatch->GetNewPrompter(domWindow, getter_AddRefs(mPrompter));
     }
   }
 }
 
 void
 nsDocShellTreeOwner::EnsureAuthPrompter()
 {
   if (mAuthPrompter) {
     return;
   }
 
   nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
   if (wwatch && mWebBrowser) {
-    nsCOMPtr<mozIDOMWindowProxy> domWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow;
     mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
     if (domWindow) {
       wwatch->GetNewAuthPrompter(domWindow, getter_AddRefs(mAuthPrompter));
     }
   }
 }
 
 void
 nsDocShellTreeOwner::AddToWatcher()
 {
   if (mWebBrowser) {
-    nsCOMPtr<mozIDOMWindowProxy> domWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow;
     mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
     if (domWindow) {
       nsCOMPtr<nsPIWindowWatcher> wwatch(
         do_GetService(NS_WINDOWWATCHER_CONTRACTID));
       if (wwatch) {
         nsCOMPtr<nsIWebBrowserChrome> webBrowserChrome = GetWebBrowserChrome();
         if (webBrowserChrome) {
           wwatch->AddWindow(domWindow, webBrowserChrome);
@@ -222,17 +222,17 @@ nsDocShellTreeOwner::AddToWatcher()
     }
   }
 }
 
 void
 nsDocShellTreeOwner::RemoveFromWatcher()
 {
   if (mWebBrowser) {
-    nsCOMPtr<mozIDOMWindowProxy> domWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow;
     mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
     if (domWindow) {
       nsCOMPtr<nsPIWindowWatcher> wwatch(
         do_GetService(NS_WINDOWWATCHER_CONTRACTID));
       if (wwatch) {
         wwatch->RemoveWindow(domWindow);
       }
     }
--- a/docshell/base/nsILoadContext.idl
+++ b/docshell/base/nsILoadContext.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: ft=cpp tw=78 sw=2 et ts=2 sts=2 cin
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 webidl Element;
 
 [ref] native OriginAttributes(mozilla::OriginAttributes);
 
 %{C++
 #ifdef MOZILLA_INTERNAL_API
 #include "mozilla/BasePrincipal.h" // for OriginAttributes
@@ -28,25 +28,25 @@ interface nsILoadContext : nsISupports
 {
   /**
    * associatedWindow is the window with which the load is associated, if any.
    * Note that the load may be triggered by a document which is different from
    * the document in associatedWindow, and in fact the source of the load need
    * not be same-origin with the document in associatedWindow.  This attribute
    * may be null if there is no associated window.
    */
-  readonly attribute mozIDOMWindowProxy associatedWindow;
+  readonly attribute WindowProxy associatedWindow;
 
   /**
    * topWindow is the top window which is of same type as associatedWindow.
    * This is equivalent to associatedWindow.top, but is provided here as a
    * convenience.  All the same caveats as associatedWindow of apply, of
    * course.  This attribute may be null if there is no associated window.
    */
-  readonly attribute mozIDOMWindowProxy topWindow;
+  readonly attribute WindowProxy topWindow;
 
   /**
    * topFrameElement is the <iframe>, <frame>, or <browser> element which
    * contains the topWindow with which the load is associated.
    *
    * Note that we may have a topFrameElement even when we don't have an
    * associatedWindow, if the topFrameElement's content lives out of process.
    * topFrameElement is available in single-process and multiprocess contexts.
--- a/dom/audiochannel/AudioChannelAgent.cpp
+++ b/dom/audiochannel/AudioChannelAgent.cpp
@@ -52,25 +52,25 @@ void
 AudioChannelAgent::Shutdown()
 {
   if (mIsRegToService) {
     NotifyStoppedPlaying();
   }
 }
 
 NS_IMETHODIMP
-AudioChannelAgent::Init(mozIDOMWindow* aWindow,
+AudioChannelAgent::Init(nsPIDOMWindowInner* aWindow,
                         nsIAudioChannelAgentCallback *aCallback)
 {
   return InitInternal(nsPIDOMWindowInner::From(aWindow),
                       aCallback, /* useWeakRef = */ false);
 }
 
 NS_IMETHODIMP
-AudioChannelAgent::InitWithWeakCallback(mozIDOMWindow* aWindow,
+AudioChannelAgent::InitWithWeakCallback(nsPIDOMWindowInner* aWindow,
                                         nsIAudioChannelAgentCallback *aCallback)
 {
   return InitInternal(nsPIDOMWindowInner::From(aWindow),
                       aCallback, /* useWeakRef = */ true);
 }
 
 nsresult
 AudioChannelAgent::FindCorrectWindow(nsPIDOMWindowInner* aWindow)
--- a/dom/audiochannel/nsIAudioChannelAgent.idl
+++ b/dom/audiochannel/nsIAudioChannelAgent.idl
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 
 typedef uint32_t nsSuspendedTypes;
 
 [scriptable, builtinclass, uuid(2822a840-f009-11e5-a837-0800200c9a66)]
 interface nsISuspendedTypes : nsISupports
 {
   /**
    * The suspended enum is used in three different situations,
@@ -110,26 +110,26 @@ interface nsIAudioChannelAgent : nsISupp
    * @param callback
    *    1. Once the playable status changes, agent uses this callback function
    *       to notify Gecko component.
    *    2. The callback is allowed to be null. Ex: telephony doesn't need to
    *       listen change of the playable status.
    *    3. The AudioChannelAgent keeps a strong reference to the callback
    *       object.
    */
-  void init(in mozIDOMWindow window, in nsIAudioChannelAgentCallback callback);
+  void init(in Window window, in nsIAudioChannelAgentCallback callback);
 
   /**
    * This method is just like init(), except the audio channel agent keeps a
    * weak reference to the callback object.
    *
    * In order for this to work, |callback| must implement
    * nsISupportsWeakReference.
    */
-  void initWithWeakCallback(in mozIDOMWindow window,
+  void initWithWeakCallback(in Window window,
                             in nsIAudioChannelAgentCallback callback);
 
   /**
    * Notify the agent that we want to start playing.
    * Note: Gecko component SHOULD call this function first then start to
    *          play audio stream only when return value is true.
    *
    * @param config
--- a/dom/base/DOMRequest.cpp
+++ b/dom/base/DOMRequest.cpp
@@ -198,17 +198,17 @@ DOMRequest::Then(JSContext* aCx, AnyCall
   JS::Rooted<JSObject*> global(aCx, mPromise->PromiseObj());
   global = js::GetGlobalForObjectCrossCompartment(global);
   mPromise->Then(aCx, global, aResolveCallback, aRejectCallback, aRetval, aRv);
 }
 
 NS_IMPL_ISUPPORTS(DOMRequestService, nsIDOMRequestService)
 
 NS_IMETHODIMP
-DOMRequestService::CreateRequest(mozIDOMWindow* aWindow,
+DOMRequestService::CreateRequest(nsPIDOMWindowInner* aWindow,
                                  DOMRequest** aRequest)
 {
   MOZ_ASSERT(NS_IsMainThread());
   NS_ENSURE_STATE(aWindow);
   auto* win = nsPIDOMWindowInner::From(aWindow);
   RefPtr<DOMRequest> req = new DOMRequest(win);
   req.forget(aRequest);
 
--- a/dom/base/TabGroup.cpp
+++ b/dom/base/TabGroup.cpp
@@ -84,17 +84,17 @@ TabGroup::GetChromeTabGroup()
   if (!sChromeTabGroup) {
     sChromeTabGroup = new TabGroup(true /* chrome tab group */);
     ClearOnShutdown(&sChromeTabGroup);
   }
   return sChromeTabGroup;
 }
 
 /* static */ TabGroup*
-TabGroup::GetFromWindow(mozIDOMWindowProxy* aWindow)
+TabGroup::GetFromWindow(nsPIDOMWindowOuter* aWindow)
 {
   if (TabChild* tabChild = TabChild::GetFrom(aWindow)) {
     return tabChild->TabGroup();
   }
 
   return nullptr;
 }
 
--- a/dom/base/TabGroup.h
+++ b/dom/base/TabGroup.h
@@ -12,17 +12,17 @@
 #include "nsIPrincipal.h"
 #include "nsTHashtable.h"
 #include "nsString.h"
 
 #include "mozilla/Atomics.h"
 #include "mozilla/SchedulerGroup.h"
 #include "mozilla/RefPtr.h"
 
-class mozIDOMWindowProxy;
+class nsPIDOMWindowOuter;
 class nsIDocShellTreeItem;
 class nsIDocument;
 class nsPIDOMWindowOuter;
 
 namespace mozilla {
 class AbstractThread;
 class ThrottledEventQueue;
 namespace dom {
@@ -71,17 +71,17 @@ public:
   GetChromeTabGroup();
 
   // Checks if the TabChild already has a TabGroup assigned to it in
   // IPDL. Returns this TabGroup if it does. This could happen if the parent
   // process created the PBrowser and we needed to assign a TabGroup immediately
   // upon receiving the IPDL message. This method is main thread only.
   static TabGroup* GetFromActor(TabChild* aTabChild);
 
-  static TabGroup* GetFromWindow(mozIDOMWindowProxy* aWindow);
+  static TabGroup* GetFromWindow(nsPIDOMWindowOuter* aWindow);
 
   explicit TabGroup(bool aIsChrome = false);
 
   // Get the docgroup for the corresponding doc group key.
   // Returns null if the given key hasn't been seen yet.
   already_AddRefed<DocGroup>
   GetDocGroup(const nsACString& aKey);
 
--- a/dom/base/TextInputProcessor.cpp
+++ b/dom/base/TextInputProcessor.cpp
@@ -326,46 +326,46 @@ TextInputProcessor::GetHasComposition(bo
   MOZ_RELEASE_ASSERT(aHasComposition, "aHasComposition must not be nullptr");
   MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
   *aHasComposition = IsComposing();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TextInputProcessor::BeginInputTransaction(
-                      mozIDOMWindow* aWindow,
+                      nsPIDOMWindowInner* aWindow,
                       nsITextInputProcessorCallback* aCallback,
                       bool* aSucceeded)
 {
   MOZ_RELEASE_ASSERT(aSucceeded, "aSucceeded must not be nullptr");
   MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
   if (NS_WARN_IF(!aCallback)) {
     *aSucceeded = false;
     return NS_ERROR_INVALID_ARG;
   }
   return BeginInputTransactionInternal(aWindow, aCallback, false, *aSucceeded);
 }
 
 NS_IMETHODIMP
 TextInputProcessor::BeginInputTransactionForTests(
-                      mozIDOMWindow* aWindow,
+                      nsPIDOMWindowInner* aWindow,
                       nsITextInputProcessorCallback* aCallback,
                       uint8_t aOptionalArgc,
                       bool* aSucceeded)
 {
   MOZ_RELEASE_ASSERT(aSucceeded, "aSucceeded must not be nullptr");
   MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
   nsITextInputProcessorCallback* callback =
     aOptionalArgc >= 1 ? aCallback : nullptr;
   return BeginInputTransactionInternal(aWindow, callback, true, *aSucceeded);
 }
 
 nsresult
 TextInputProcessor::BeginInputTransactionInternal(
-                      mozIDOMWindow* aWindow,
+                      nsPIDOMWindowInner* aWindow,
                       nsITextInputProcessorCallback* aCallback,
                       bool aForTests,
                       bool& aSucceeded)
 {
   aSucceeded = false;
   if (NS_WARN_IF(!aWindow)) {
     return NS_ERROR_INVALID_ARG;
   }
--- a/dom/base/TextInputProcessor.h
+++ b/dom/base/TextInputProcessor.h
@@ -50,17 +50,17 @@ public:
                       void* aData) override;
 
 protected:
   virtual ~TextInputProcessor();
 
 private:
   bool IsComposing() const;
   nsresult BeginInputTransactionInternal(
-             mozIDOMWindow* aWindow,
+             nsPIDOMWindowInner* aWindow,
              nsITextInputProcessorCallback* aCallback,
              bool aForTests,
              bool& aSucceeded);
   nsresult CommitCompositionInternal(
              const WidgetKeyboardEvent* aKeyboardEvent = nullptr,
              uint32_t aKeyFlags = 0,
              const nsAString* aCommitString = nullptr,
              bool* aSucceeded = nullptr);
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -60,17 +60,17 @@ ThirdPartyUtil::IsThirdPartyInternal(con
 
   // Check strict equality.
   *aResult = aFirstDomain != secondDomain;
   return NS_OK;
 }
 
 // Get the URI associated with a window.
 NS_IMETHODIMP
-ThirdPartyUtil::GetURIFromWindow(mozIDOMWindowProxy* aWin, nsIURI** result)
+ThirdPartyUtil::GetURIFromWindow(nsPIDOMWindowOuter* aWin, nsIURI** result)
 {
   nsresult rv;
   nsCOMPtr<nsIScriptObjectPrincipal> scriptObjPrin = do_QueryInterface(aWin);
   if (!scriptObjPrin) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsIPrincipal* prin = scriptObjPrin->GetPrincipal();
@@ -104,17 +104,17 @@ ThirdPartyUtil::IsThirdPartyURI(nsIURI* 
     return rv;
 
   return IsThirdPartyInternal(firstHost, aSecondURI, aResult);
 }
 
 // Determine if any URI of the window hierarchy of aWindow is foreign with
 // respect to aSecondURI. See docs for mozIThirdPartyUtil.
 NS_IMETHODIMP
-ThirdPartyUtil::IsThirdPartyWindow(mozIDOMWindowProxy* aWindow,
+ThirdPartyUtil::IsThirdPartyWindow(nsPIDOMWindowOuter* aWindow,
                                    nsIURI* aURI,
                                    bool* aResult)
 {
   NS_ENSURE_ARG(aWindow);
   NS_ASSERTION(aResult, "null outparam pointer");
 
   bool result;
 
@@ -247,28 +247,28 @@ ThirdPartyUtil::IsThirdPartyChannel(nsIC
     return NS_OK;
   }
 
   // Determine whether aURI is foreign with respect to channelURI.
   return IsThirdPartyInternal(channelDomain, aURI, aResult);
 }
 
 NS_IMETHODIMP
-ThirdPartyUtil::GetTopWindowForChannel(nsIChannel* aChannel, mozIDOMWindowProxy** aWin)
+ThirdPartyUtil::GetTopWindowForChannel(nsIChannel* aChannel, nsPIDOMWindowOuter** aWin)
 {
   NS_ENSURE_ARG(aWin);
 
   // Find the associated window and its parent window.
   nsCOMPtr<nsILoadContext> ctx;
   NS_QueryNotificationCallbacks(aChannel, ctx);
   if (!ctx) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   ctx->GetAssociatedWindow(getter_AddRefs(window));
   if (!window) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> top = nsPIDOMWindowOuter::From(window)->GetTop();
   top.forget(aWin);
   return NS_OK;
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -620,17 +620,17 @@ nsContentPermissionRequestProxy::GetType
   if (mozilla::dom::nsContentPermissionUtils::ConvertPermissionRequestToArray(mPermissionRequests, types)) {
     types.forget(aTypes);
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsContentPermissionRequestProxy::GetWindow(mozIDOMWindow * *aRequestingWindow)
+nsContentPermissionRequestProxy::GetWindow(nsPIDOMWindowInner * *aRequestingWindow)
 {
   NS_ENSURE_ARG_POINTER(aRequestingWindow);
   *aRequestingWindow = nullptr; // ipc doesn't have a window
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContentPermissionRequestProxy::GetPrincipal(nsIPrincipal * *aRequestingPrincipal)
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5654,17 +5654,17 @@ nsContentUtils::GetWindowProviderForCont
 }
 
 /* static */
 already_AddRefed<nsPIDOMWindowOuter>
 nsContentUtils::GetMostRecentNonPBWindow()
 {
   nsCOMPtr<nsIWindowMediator> wm = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   wm->GetMostRecentNonPBWindow(u"navigator:browser",
                                getter_AddRefs(window));
   nsCOMPtr<nsPIDOMWindowOuter> pwindow;
   pwindow = do_QueryInterface(window);
 
   return pwindow.forget();
 }
 
@@ -7636,17 +7636,17 @@ nsContentUtils::GetInnerWindowID(nsILoad
     return 0;
   }
 
   nsCOMPtr<nsILoadContext> loadContext = do_GetInterface(callbacks);
   if (!loadContext) {
     return 0;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   rv = loadContext->GetAssociatedWindow(getter_AddRefs(window));
   if (NS_FAILED(rv) || !window) {
     return 0;
   }
 
   auto* pwindow = nsPIDOMWindowOuter::From(window);
   if (!pwindow) {
     return 0;
@@ -10163,17 +10163,17 @@ nsContentUtils::AttemptLargeAllocationLo
     return false;
   }
 
   nsCOMPtr<nsILoadContext> loadContext = do_GetInterface(callbacks);
   if (NS_WARN_IF(!loadContext)) {
     return false;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   rv = loadContext->GetAssociatedWindow(getter_AddRefs(window));
   if (NS_WARN_IF(NS_FAILED(rv) || !window)) {
     return false;
   }
 
   nsPIDOMWindowOuter* outer = nsPIDOMWindowOuter::From(window);
   if (NS_WARN_IF(!outer)) {
     return false;
--- a/dom/base/nsDOMWindowList.cpp
+++ b/dom/base/nsDOMWindowList.cpp
@@ -88,25 +88,25 @@ nsDOMWindowList::IndexedGetter(uint32_t 
 
   nsCOMPtr<nsPIDOMWindowOuter> window = item->GetWindow();
   MOZ_ASSERT(window);
 
   return window.forget();
 }
 
 NS_IMETHODIMP
-nsDOMWindowList::Item(uint32_t aIndex, mozIDOMWindowProxy** aReturn)
+nsDOMWindowList::Item(uint32_t aIndex, nsPIDOMWindowOuter** aReturn)
 {
   nsCOMPtr<nsPIDOMWindowOuter> window = IndexedGetter(aIndex);
   window.forget(aReturn);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMWindowList::NamedItem(const nsAString& aName, mozIDOMWindowProxy** aReturn)
+nsDOMWindowList::NamedItem(const nsAString& aName, nsPIDOMWindowOuter** aReturn)
 {
   nsCOMPtr<nsIDocShellTreeItem> item;
 
   *aReturn = nullptr;
 
   EnsureFresh();
 
   if (mDocShellNode) {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3427,17 +3427,17 @@ nsIDocument::HasFocus(ErrorResult& rv) c
 {
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (!fm) {
     rv.Throw(NS_ERROR_NOT_AVAILABLE);
     return false;
   }
 
   // Is there a focused DOMWindow?
-  nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
   fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
   if (!focusedWindow) {
     return false;
   }
 
   nsPIDOMWindowOuter* piWindow = nsPIDOMWindowOuter::From(focusedWindow);
 
   // Are we an ancestor of the focused DOMWindow?
@@ -10854,17 +10854,17 @@ IsInActiveTab(nsIDocument* aDoc)
     return false;
   }
 
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (!fm) {
     return false;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> activeWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> activeWindow;
   fm->GetActiveWindow(getter_AddRefs(activeWindow));
   if (!activeWindow) {
     return false;
   }
 
   return activeWindow == rootWin;
 }
 
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -413,43 +413,43 @@ nsFocusManager::GetFocusMoveActionCause(
     return InputContextAction::CAUSE_MOUSE;
   } else if (aFlags & nsIFocusManager::FLAG_BYKEY) {
     return InputContextAction::CAUSE_KEY;
   }
   return InputContextAction::CAUSE_UNKNOWN;
 }
 
 NS_IMETHODIMP
-nsFocusManager::GetActiveWindow(mozIDOMWindowProxy** aWindow)
+nsFocusManager::GetActiveWindow(nsPIDOMWindowOuter** aWindow)
 {
   NS_IF_ADDREF(*aWindow = mActiveWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::SetActiveWindow(mozIDOMWindowProxy* aWindow)
+nsFocusManager::SetActiveWindow(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_STATE(aWindow);
 
   // only top-level windows can be made active
   nsCOMPtr<nsPIDOMWindowOuter> piWindow = nsPIDOMWindowOuter::From(aWindow);
   NS_ENSURE_TRUE(piWindow == piWindow->GetPrivateRoot(), NS_ERROR_INVALID_ARG);
 
   RaiseWindow(piWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::GetFocusedWindow(mozIDOMWindowProxy** aFocusedWindow)
+nsFocusManager::GetFocusedWindow(nsPIDOMWindowOuter** aFocusedWindow)
 {
   NS_IF_ADDREF(*aFocusedWindow = mFocusedWindow);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsFocusManager::SetFocusedWindow(mozIDOMWindowProxy* aWindowToFocus)
+NS_IMETHODIMP nsFocusManager::SetFocusedWindow(nsPIDOMWindowOuter* aWindowToFocus)
 {
   LOGFOCUS(("<<SetFocusedWindow begin>>"));
 
   nsCOMPtr<nsPIDOMWindowOuter> windowToFocus = nsPIDOMWindowOuter::From(aWindowToFocus);
   NS_ENSURE_TRUE(windowToFocus, NS_ERROR_FAILURE);
 
   windowToFocus = windowToFocus->GetOuterWindow();
 
@@ -484,17 +484,17 @@ NS_IMETHODIMP
 nsFocusManager::GetFocusedElement(Element** aFocusedElement)
 {
   RefPtr<Element> focusedElement = mFocusedElement;
   focusedElement.forget(aFocusedElement);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::GetLastFocusMethod(mozIDOMWindowProxy* aWindow, uint32_t* aLastFocusMethod)
+nsFocusManager::GetLastFocusMethod(nsPIDOMWindowOuter* aWindow, uint32_t* aLastFocusMethod)
 {
   // the focus method is stored on the inner window
   nsCOMPtr<nsPIDOMWindowOuter> window;
   if (aWindow) {
     window = nsPIDOMWindowOuter::From(aWindow);
   }
   if (!window)
     window = mFocusedWindow;
@@ -527,17 +527,17 @@ nsFocusManager::ElementIsFocusable(Eleme
   NS_ENSURE_TRUE(aElement, NS_ERROR_INVALID_ARG);
 
   *aIsFocusable = CheckIfFocusable(aElement, aFlags) != nullptr;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::MoveFocus(mozIDOMWindowProxy* aWindow, Element* aStartElement,
+nsFocusManager::MoveFocus(nsPIDOMWindowOuter* aWindow, Element* aStartElement,
                           uint32_t aType, uint32_t aFlags, Element** aElement)
 {
   *aElement = nullptr;
 
   LOGFOCUS(("<<MoveFocus begin Type: %d Flags: %x>>", aType, aFlags));
 
   if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug) && mFocusedWindow) {
     nsIDocument* doc = mFocusedWindow->GetExtantDoc();
@@ -594,17 +594,17 @@ nsFocusManager::MoveFocus(mozIDOMWindowP
   }
 
   LOGFOCUS(("<<MoveFocus end>>"));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::ClearFocus(mozIDOMWindowProxy* aWindow)
+nsFocusManager::ClearFocus(nsPIDOMWindowOuter* aWindow)
 {
   LOGFOCUS(("<<ClearFocus begin>>"));
 
   // if the window to clear is the focused window or an ancestor of the
   // focused window, then blur the existing focused content. Otherwise, the
   // focus is somewhere else so just update the current node.
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
@@ -623,19 +623,19 @@ nsFocusManager::ClearFocus(mozIDOMWindow
   }
 
   LOGFOCUS(("<<ClearFocus end>>"));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::GetFocusedElementForWindow(mozIDOMWindowProxy* aWindow,
+nsFocusManager::GetFocusedElementForWindow(nsPIDOMWindowOuter* aWindow,
                                            bool aDeep,
-                                           mozIDOMWindowProxy** aFocusedWindow,
+                                           nsPIDOMWindowOuter** aFocusedWindow,
                                            Element** aElement)
 {
   *aElement = nullptr;
   if (aFocusedWindow)
     *aFocusedWindow = nullptr;
 
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
@@ -651,17 +651,17 @@ nsFocusManager::GetFocusedElementForWind
 
   if (aFocusedWindow)
     NS_IF_ADDREF(*aFocusedWindow = focusedWindow);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::MoveCaretToFocus(mozIDOMWindowProxy* aWindow)
+nsFocusManager::MoveCaretToFocus(nsPIDOMWindowOuter* aWindow)
 {
   nsCOMPtr<nsIWebNavigation> webnav = do_GetInterface(aWindow);
   nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(webnav);
   if (dsti) {
     if (dsti->ItemType() != nsIDocShellTreeItem::typeChrome) {
       nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(dsti);
       NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
 
@@ -680,17 +680,17 @@ nsFocusManager::MoveCaretToFocus(mozIDOM
         MoveCaretToFocus(presShell, content);
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::WindowRaised(mozIDOMWindowProxy* aWindow)
+nsFocusManager::WindowRaised(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
 
   if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
     LOGFOCUS(("Window %p Raised [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
@@ -766,17 +766,17 @@ nsFocusManager::WindowRaised(mozIDOMWind
   // Pass false for aWindowRaised so that commands get updated.
   nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(baseWindow));
   Focus(currentWindow, currentFocus, 0, true, false, xulWin != nullptr, true);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::WindowLowered(mozIDOMWindowProxy* aWindow)
+nsFocusManager::WindowLowered(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
 
   if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
     LOGFOCUS(("Window %p Lowered [Currently: %p %p]", aWindow, mActiveWindow.get(), mFocusedWindow.get()));
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
@@ -889,17 +889,17 @@ nsFocusManager::ContentRemoved(nsIDocume
 
     NotifyFocusStateChange(content, nullptr, shouldShowFocusRing, false);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::WindowShown(mozIDOMWindowProxy* aWindow, bool aNeedsFocus)
+nsFocusManager::WindowShown(nsPIDOMWindowOuter* aWindow, bool aNeedsFocus)
 {
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
 
   if (MOZ_LOG_TEST(gFocusLog, LogLevel::Debug)) {
     LOGFOCUS(("Window %p Shown [Currently: %p %p]", window.get(), mActiveWindow.get(), mFocusedWindow.get()));
     nsIDocument* doc = window->GetExtantDoc();
     if (doc && doc->GetDocumentURI()) {
@@ -940,17 +940,17 @@ nsFocusManager::WindowShown(mozIDOMWindo
     // When the window becomes visible, make sure the right widget is focused.
     EnsureCurrentWidgetFocused();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::WindowHidden(mozIDOMWindowProxy* aWindow)
+nsFocusManager::WindowHidden(nsPIDOMWindowOuter* aWindow)
 {
   // if there is no window or it is not the same or an ancestor of the
   // currently focused window, just return, as the current focus will not
   // be affected.
 
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
 
@@ -1096,17 +1096,17 @@ NS_IMETHODIMP
 nsFocusManager::FocusPlugin(Element* aPlugin)
 {
   NS_ENSURE_ARG(aPlugin);
   SetFocusInner(aPlugin, 0, true, false);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsFocusManager::ParentActivated(mozIDOMWindowProxy* aWindow, bool aActive)
+nsFocusManager::ParentActivated(nsPIDOMWindowOuter* aWindow, bool aActive)
 {
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
   NS_ENSURE_TRUE(window, NS_ERROR_INVALID_ARG);
 
   ActivateOrDeactivate(window, aActive);
   return NS_OK;
 }
 
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -4764,17 +4764,17 @@ nsGlobalWindowOuter::FocusOuter(ErrorRes
 
   // Enforce dom.disable_window_flip (for non-chrome), but still allow the
   // window which opened us to raise us at times when popups are allowed
   // (bugs 355482 and 369306).
   bool canFocus = CanSetProperty("dom.disable_window_flip") ||
                     (opener == callerOuter &&
                      RevisePopupAbuseLevel(GetPopupControlState()) < openBlocked);
 
-  nsCOMPtr<mozIDOMWindowProxy> activeDOMWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> activeDOMWindow;
   fm->GetActiveWindow(getter_AddRefs(activeDOMWindow));
 
   nsCOMPtr<nsIDocShellTreeItem> rootItem;
   mDocShell->GetRootTreeItem(getter_AddRefs(rootItem));
   nsCOMPtr<nsPIDOMWindowOuter> rootWin = rootItem ? rootItem->GetWindow() : nullptr;
   auto* activeWindow = nsPIDOMWindowOuter::From(activeDOMWindow);
   bool isActive = (rootWin == activeWindow);
 
@@ -6986,17 +6986,17 @@ nsGlobalWindowOuter::OpenInternal(const 
         }
       }
 
       FireAbuseEvents(aUrl, aName, aOptions);
       return aDoJSFixups ? NS_OK : NS_ERROR_FAILURE;
     }
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> domReturn;
+  nsCOMPtr<nsPIDOMWindowOuter> domReturn;
 
   nsCOMPtr<nsIWindowWatcher> wwatch =
     do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
   NS_ENSURE_TRUE(wwatch, rv);
 
   NS_ConvertUTF16toUTF8 options(aOptions);
   NS_ConvertUTF16toUTF8 name(aName);
 
--- a/dom/base/nsIDOMRequestService.idl
+++ b/dom/base/nsIDOMRequestService.idl
@@ -1,21 +1,21 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 webidl DOMRequest;
 
 [scriptable, builtinclass, uuid(9a57e5de-ce93-45fa-8145-755722834f7c)]
 interface nsIDOMRequestService : nsISupports
 {
-  DOMRequest createRequest(in mozIDOMWindow window);
+  DOMRequest createRequest(in Window window);
 
   void fireSuccess(in DOMRequest request, in jsval result);
   void fireError(in DOMRequest request, in DOMString error);
   void fireSuccessAsync(in DOMRequest request, in jsval result);
   void fireErrorAsync(in DOMRequest request, in DOMString error);
 };
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1124,17 +1124,17 @@ nsObjectLoadingContent::OnDataAvailable(
 NS_IMETHODIMP_(already_AddRefed<nsFrameLoader>)
 nsObjectLoadingContent::GetFrameLoader()
 {
   RefPtr<nsFrameLoader> loader = mFrameLoader;
   return loader.forget();
 }
 
 void
-nsObjectLoadingContent::PresetOpenerWindow(mozIDOMWindowProxy* aWindow, mozilla::ErrorResult& aRv)
+nsObjectLoadingContent::PresetOpenerWindow(nsPIDOMWindowOuter* aWindow, mozilla::ErrorResult& aRv)
 {
   aRv.Throw(NS_ERROR_FAILURE);
 }
 
 void
 nsObjectLoadingContent::InternalSetFrameLoader(nsFrameLoader* aNewFrameLoader)
 {
   MOZ_CRASH("You shouldn't be calling this function, it doesn't make any sense on this type.");
--- a/dom/base/nsObjectLoadingContent.h
+++ b/dom/base/nsObjectLoadingContent.h
@@ -252,17 +252,17 @@ class nsObjectLoadingContent : public ns
     uint32_t GetRunID(mozilla::dom::SystemCallerGuarantee,
                       mozilla::ErrorResult& aRv);
 
     bool IsRewrittenYoutubeEmbed() const
     {
       return mRewrittenYoutubeEmbed;
     }
 
-    void PresetOpenerWindow(mozIDOMWindowProxy* aOpenerWindow, mozilla::ErrorResult& aRv);
+    void PresetOpenerWindow(nsPIDOMWindowOuter* aOpenerWindow, mozilla::ErrorResult& aRv);
 
   protected:
     /**
      * Begins loading the object when called
      *
      * Attributes of |this| QI'd to nsIContent will be inspected, depending on
      * the node type. This function currently assumes it is a <object> or
      * <embed> tag.
--- a/dom/base/nsWindowMemoryReporter.cpp
+++ b/dom/base/nsWindowMemoryReporter.cpp
@@ -70,17 +70,17 @@ AddNonJSSizeOfWindowAndItsDescendents(ns
   nsCOMPtr<nsIDOMWindowCollection> frames = aWindow->GetFrames();
 
   uint32_t length;
   nsresult rv = frames->GetLength(&length);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Measure this window's descendents.
   for (uint32_t i = 0; i < length; i++) {
-      nsCOMPtr<mozIDOMWindowProxy> child;
+      nsCOMPtr<nsPIDOMWindowOuter> child;
       rv = frames->Item(i, getter_AddRefs(child));
       NS_ENSURE_SUCCESS(rv, rv);
       NS_ENSURE_STATE(child);
 
       nsGlobalWindowOuter* childWin = nsGlobalWindowOuter::Cast(child);
 
       rv = AddNonJSSizeOfWindowAndItsDescendents(childWin, aSizes);
       NS_ENSURE_SUCCESS(rv, rv);
@@ -850,17 +850,17 @@ nsWindowMemoryReporter::CheckForGhostWin
 
   // Update mDetachedWindows and write the ghost window IDs into aOutGhostIDs,
   // if it's not null.
   uint32_t ghostTimeout = GetGhostTimeout();
   TimeStamp now = mLastCheckForGhostWindows;
   mGhostWindowCount = 0;
   for (auto iter = mDetachedWindows.Iter(); !iter.Done(); iter.Next()) {
     nsWeakPtr weakKey = do_QueryInterface(iter.Key());
-    nsCOMPtr<mozIDOMWindow> iwindow = do_QueryReferent(weakKey);
+    nsCOMPtr<nsPIDOMWindowInner> iwindow = do_QueryReferent(weakKey);
     if (!iwindow) {
       // The window object has been destroyed.  Stop tracking its weak ref in
       // our hashtable.
       iter.Remove();
       continue;
     }
 
     nsPIDOMWindowInner* window = nsPIDOMWindowInner::From(iwindow);
--- a/dom/base/test/chrome/test_bug1339722.html
+++ b/dom/base/test/chrome/test_bug1339722.html
@@ -25,17 +25,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   const TOPIC = 'http-on-useragent-request';
   Services.obs.addObserver({
     observe(subject, topic, data) {
       info('Got ' + topic);
       Services.obs.removeObserver(this, TOPIC);
 
       // Query window proxy so it triggers DOMWindowCreated.
       let channel = subject.QueryInterface(Ci.nsIHttpChannel);
-      let win = channel.notificationCallbacks.getInterface(Ci.mozIDOMWindowProxy);
+      let win = channel.notificationCallbacks.getInterface(Ci.nsIDOMWindow);
     }
   }, TOPIC);
 
   let docShell = SpecialPowers.wrap(window)
                               .QueryInterface(Ci.nsIInterfaceRequestor)
                               .getInterface(Ci.nsIDocShell);
   docShell.chromeEventHandler.addEventListener('DOMWindowCreated', function handler(e) {
     docShell.chromeEventHandler.removeEventListener('DOMWindowCreated', handler);
--- a/dom/browser-element/BrowserElementParent.cpp
+++ b/dom/browser-element/BrowserElementParent.cpp
@@ -228,17 +228,17 @@ BrowserElementParent::OpenWindowOOP(TabP
 
 /* static */
 BrowserElementParent::OpenWindowResult
 BrowserElementParent::OpenWindowInProcess(nsPIDOMWindowOuter* aOpenerWindow,
                                           nsIURI* aURI,
                                           const nsAString& aName,
                                           const nsACString& aFeatures,
                                           bool aForceNoOpener,
-                                          mozIDOMWindowProxy** aReturnWindow)
+                                          nsPIDOMWindowOuter** aReturnWindow)
 {
   *aReturnWindow = nullptr;
 
   // If we call window.open from an <iframe> inside an <iframe mozbrowser>,
   // it's as though the top-level document inside the <iframe mozbrowser>
   // called window.open.  (Indeed, in the OOP case, the inner <iframe> lives
   // out-of-process, so we couldn't touch it if we tried.)
   //
--- a/dom/browser-element/BrowserElementParent.h
+++ b/dom/browser-element/BrowserElementParent.h
@@ -114,17 +114,17 @@ public:
    *         the platform from handling the open request
    */
   static OpenWindowResult
   OpenWindowInProcess(nsPIDOMWindowOuter* aOpenerWindow,
                       nsIURI* aURI,
                       const nsAString& aName,
                       const nsACString& aFeatures,
                       bool aForceNoOpener,
-                      mozIDOMWindowProxy** aReturnWindow);
+                      nsPIDOMWindowOuter** aReturnWindow);
 
 private:
   static OpenWindowResult
   DispatchOpenWindowEvent(dom::Element* aOpenerFrameElement,
                           dom::Element* aPopupFrameElement,
                           const nsAString& aURL,
                           const nsAString& aName,
                           const nsAString& aFeatures);
--- a/dom/clients/manager/ClientOpenWindowUtils.cpp
+++ b/dom/clients/manager/ClientOpenWindowUtils.cpp
@@ -210,17 +210,17 @@ OpenWindow(const ClientOpenWindowArgs& a
     NS_ENSURE_STATE(pwwatch);
 
     nsCString spec;
     rv = uri->GetSpec(spec);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
-    nsCOMPtr<mozIDOMWindowProxy> newWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> newWindow;
     rv = pwwatch->OpenWindow2(nullptr,
                               spec.get(),
                               nullptr,
                               nullptr,
                               false, false, true, nullptr,
                               // Not a spammy popup; we got permission, we swear!
                               /* aIsPopupSpam = */ false,
                               // Don't force noopener.  We're not passing in an
@@ -255,17 +255,17 @@ OpenWindow(const ClientOpenWindowArgs& a
 
   nsCOMPtr<nsIBrowserDOMWindow> bwin;
   chromeWin->GetBrowserDOMWindow(getter_AddRefs(bwin));
 
   if (NS_WARN_IF(!bwin)) {
     return NS_ERROR_FAILURE;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> win;
+  nsCOMPtr<nsPIDOMWindowOuter> win;
   rv = bwin->OpenURI(uri, nullptr,
                      nsIBrowserDOMWindow::OPEN_DEFAULTWINDOW,
                      nsIBrowserDOMWindow::OPEN_NEW,
                      principal,
                      getter_AddRefs(win));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
--- a/dom/commandhandler/nsCommandManager.cpp
+++ b/dom/commandhandler/nsCommandManager.cpp
@@ -55,17 +55,17 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsComma
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCommandManager)
   NS_INTERFACE_MAP_ENTRY(nsICommandManager)
   NS_INTERFACE_MAP_ENTRY(nsPICommandUpdater)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsICommandManager)
 NS_INTERFACE_MAP_END
 
 NS_IMETHODIMP
-nsCommandManager::Init(mozIDOMWindowProxy* aWindow)
+nsCommandManager::Init(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_ARG_POINTER(aWindow);
 
   mWindow = aWindow; // weak ptr
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -132,31 +132,31 @@ nsCommandManager::RemoveCommandObserver(
 
   commandObservers->RemoveElement(aCommandObserver);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCommandManager::IsCommandSupported(const char* aCommandName,
-                                     mozIDOMWindowProxy* aTargetWindow,
+                                     nsPIDOMWindowOuter* aTargetWindow,
                                      bool* aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   nsCOMPtr<nsIController> controller;
   GetControllerForCommand(aCommandName, aTargetWindow,
                           getter_AddRefs(controller));
   *aResult = (controller.get() != nullptr);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCommandManager::IsCommandEnabled(const char* aCommandName,
-                                   mozIDOMWindowProxy* aTargetWindow,
+                                   nsPIDOMWindowOuter* aTargetWindow,
                                    bool* aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
 
   bool commandEnabled = false;
 
   nsCOMPtr<nsIController> controller;
   GetControllerForCommand(aCommandName, aTargetWindow,
@@ -165,17 +165,17 @@ nsCommandManager::IsCommandEnabled(const
     controller->IsCommandEnabled(aCommandName, &commandEnabled);
   }
   *aResult = commandEnabled;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCommandManager::GetCommandState(const char* aCommandName,
-                                  mozIDOMWindowProxy* aTargetWindow,
+                                  nsPIDOMWindowOuter* aTargetWindow,
                                   nsICommandParams* aCommandParams)
 {
   nsCOMPtr<nsIController> controller;
   nsAutoString tValue;
   nsresult rv = GetControllerForCommand(aCommandName, aTargetWindow,
                                         getter_AddRefs(controller));
   if (!controller) {
     return NS_ERROR_FAILURE;
@@ -190,17 +190,17 @@ nsCommandManager::GetCommandState(const 
     rv = NS_ERROR_NOT_IMPLEMENTED;
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsCommandManager::DoCommand(const char* aCommandName,
                             nsICommandParams* aCommandParams,
-                            mozIDOMWindowProxy* aTargetWindow)
+                            nsPIDOMWindowOuter* aTargetWindow)
 {
   nsCOMPtr<nsIController> controller;
   nsresult rv = GetControllerForCommand(aCommandName, aTargetWindow,
                                         getter_AddRefs(controller));
   if (!controller) {
     return NS_ERROR_FAILURE;
   }
 
@@ -211,17 +211,17 @@ nsCommandManager::DoCommand(const char* 
   } else {
     rv = controller->DoCommand(aCommandName);
   }
   return rv;
 }
 
 nsresult
 nsCommandManager::GetControllerForCommand(const char* aCommand,
-                                          mozIDOMWindowProxy* aTargetWindow,
+                                          nsPIDOMWindowOuter* aTargetWindow,
                                           nsIController** aResult)
 {
   nsresult rv = NS_ERROR_FAILURE;
   *aResult = nullptr;
 
   // check if we're in content or chrome
   // if we're not chrome we must have a target window or we bail
   if (!nsContentUtils::LegacyIsCallerChromeOrNativeCode()) {
--- a/dom/commandhandler/nsCommandManager.h
+++ b/dom/commandhandler/nsCommandManager.h
@@ -33,18 +33,18 @@ public:
 
   NS_DECL_NSICOMMANDMANAGER
   NS_DECL_NSPICOMMANDUPDATER
 
 protected:
   virtual ~nsCommandManager();
 
   nsresult GetControllerForCommand(const char* aCommand,
-                                   mozIDOMWindowProxy* aDirectedToThisWindow,
+                                   nsPIDOMWindowOuter* aDirectedToThisWindow,
                                    nsIController** aResult);
 
 protected:
   nsClassHashtable<nsCharPtrHashKey, ObserverList> mObserversTable;
 
-  mozIDOMWindowProxy* mWindow; // weak ptr. The window should always outlive us
+  nsPIDOMWindowOuter* mWindow; // weak ptr. The window should always outlive us
 };
 
 #endif // nsCommandManager_h__
--- a/dom/commandhandler/nsICommandManager.idl
+++ b/dom/commandhandler/nsICommandManager.idl
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsIObserver.idl"
 #include "nsICommandParams.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /*
  * nsICommandManager is an interface used to executing user-level commands,
  * and getting the state of available commands.
  *
  * Commands are identified by strings, which are documented elsewhere.
  * In addition, the list of required and optional parameters for
  * each command, that are passed in via the nsICommandParams, are
@@ -45,25 +45,25 @@ interface nsICommandManager : nsISupport
                                     in string aCommandObserved);
 
   /*
    * Ask the command manager if the specified command is supported.
    * If aTargetWindow is null, the focused window is used.
    *
    */
   boolean     isCommandSupported(in string aCommandName,
-                                 in mozIDOMWindowProxy aTargetWindow);
+                                 in WindowProxy aTargetWindow);
 
   /*
    * Ask the command manager if the specified command is currently.
    * enabled.
    * If aTargetWindow is null, the focused window is used.
    */
   boolean     isCommandEnabled(in string aCommandName,
-                               in mozIDOMWindowProxy aTargetWindow);
+                               in WindowProxy aTargetWindow);
 
   /*
    * Get the state of the specified commands.
    *
    * On input: aCommandParams filled in with values that the caller cares
    * about, most of which are command-specific (see the command documentation
    * for details). One boolean value, "enabled", applies to all commands,
    * and, in return will be set to indicate whether the command is enabled
@@ -71,31 +71,31 @@ interface nsICommandManager : nsISupport
    *
    * aCommandName is the name of the command that needs the state
    * aTargetWindow is the source of command controller 
    *      (null means use focus controller)
    * On output: aCommandParams: values set by the caller filled in with
    * state from the command.
    */
   void        getCommandState(in string aCommandName,
-                              in mozIDOMWindowProxy aTargetWindow,
+                              in WindowProxy aTargetWindow,
                   /* inout */ in nsICommandParams aCommandParams);
     
   /*
    * Execute the specified command.
    * The command will be executed in aTargetWindow if it is specified.
    * If aTargetWindow is null, it will go to the focused window.
    *
    * param: aCommandParams, a list of name-value pairs of command parameters,
    * may be null for parameter-less commands.
    *
    */
   void        doCommand(in string aCommandName,
                         in nsICommandParams aCommandParams,
-                        in mozIDOMWindowProxy aTargetWindow);
+                        in WindowProxy aTargetWindow);
 
 };
 
 
 /*
 
 Arguments to observers "Observe" method are as follows:
 
--- a/dom/commandhandler/nsPICommandUpdater.idl
+++ b/dom/commandhandler/nsPICommandUpdater.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /*
 	The nsPICommandUpdater interface is used by modules that implement
 	commands, to tell the command manager that commands need updating.
 	This is a private interface; embedders should not use it.
 	
 	Command-implementing modules should get one of these by a QI
 	from an nsICommandManager.
@@ -20,17 +20,17 @@ interface mozIDOMWindowProxy;
 interface nsPICommandUpdater : nsISupports
 {
 
   /*
    * Init the command updater, passing an nsIDOMWindow which 
    * is the window that the command updater lives on.
    * 
    */
-  void    init(in mozIDOMWindowProxy aWindow);
+  void    init(in WindowProxy aWindow);
    
   /*
    * Notify the command manager that the status of a command
    * changed. It may have changed from enabled to disabled,
    * or vice versa, or become toggled etc.
    */
 	void		commandStatusChanged(in string aCommandName);
 	
--- a/dom/credentialmanagement/CredentialsContainer.cpp
+++ b/dom/credentialmanagement/CredentialsContainer.cpp
@@ -75,17 +75,17 @@ IsInActiveTab(nsPIDOMWindowInner* aParen
     return false;
   }
 
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (!fm) {
     return false;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> activeWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> activeWindow;
   fm->GetActiveWindow(getter_AddRefs(activeWindow));
   return activeWindow == rootWin;
 }
 
 static bool
 IsSameOriginWithAncestors(nsPIDOMWindowInner* aParent)
 {
   // This method returns true if aParent is either not in a frame / iframe, or
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2179,17 +2179,17 @@ EventStateManager::GetContentViewer(nsIC
   nsCOMPtr<nsPIDOMWindowOuter> rootWindow = window->GetPrivateRoot();
   if (!rootWindow) return NS_ERROR_FAILURE;
 
   TabChild* tabChild = TabChild::GetFrom(rootWindow);
   if (!tabChild) {
     nsIFocusManager* fm = nsFocusManager::GetFocusManager();
     if (!fm) return NS_ERROR_FAILURE;
 
-    nsCOMPtr<mozIDOMWindowProxy> activeWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> activeWindow;
     fm->GetActiveWindow(getter_AddRefs(activeWindow));
     if (rootWindow != activeWindow) return NS_OK;
   } else {
     if (!tabChild->ParentIsActive()) return NS_OK;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> contentWindow =
     nsGlobalWindowOuter::Cast(rootWindow)->GetContent();
@@ -3357,17 +3357,17 @@ EventStateManager::PostHandleEvent(nsPre
         StopTrackingDragGesture();
 
         // When the event was cancelled, there is currently a chrome document
         // focused and a mousedown just occurred on a content document, ensure
         // that the window that was clicked is focused.
         EnsureDocument(mPresContext);
         nsIFocusManager* fm = nsFocusManager::GetFocusManager();
         if (mDocument && fm) {
-          nsCOMPtr<mozIDOMWindowProxy> window;
+          nsCOMPtr<nsPIDOMWindowOuter> window;
           fm->GetFocusedWindow(getter_AddRefs(window));
           auto* currentWindow = nsPIDOMWindowOuter::From(window);
           if (currentWindow && mDocument->GetWindow() &&
               currentWindow != mDocument->GetWindow() &&
               !nsContentUtils::IsChromeDoc(mDocument)) {
             nsCOMPtr<nsPIDOMWindowOuter> currentTop;
             nsCOMPtr<nsPIDOMWindowOuter> newTop;
             currentTop = currentWindow->GetTop();
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -380,17 +380,17 @@ nsGeolocationRequest::GetTypes(nsIArray*
   nsTArray<nsString> emptyOptions;
   return nsContentPermissionUtils::CreatePermissionArray(NS_LITERAL_CSTRING("geolocation"),
                                                          NS_LITERAL_CSTRING("unused"),
                                                          emptyOptions,
                                                          aTypes);
 }
 
 NS_IMETHODIMP
-nsGeolocationRequest::GetWindow(mozIDOMWindow** aRequestingWindow)
+nsGeolocationRequest::GetWindow(nsPIDOMWindowInner** aRequestingWindow)
 {
   NS_ENSURE_ARG_POINTER(aRequestingWindow);
 
   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryReferent(mLocator->GetOwner());
   window.forget(aRequestingWindow);
 
   return NS_OK;
 }
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -2108,17 +2108,17 @@ nsGenericHTMLFormElement::FocusState()
   // If the window is not active, do not allow the focus to bring the
   // window to the front.  We update the focus controller, but do
   // nothing else.
   if (nsPIDOMWindowOuter* win = doc->GetWindow()) {
     nsCOMPtr<nsPIDOMWindowOuter> rootWindow = win->GetPrivateRoot();
 
     nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
     if (fm && rootWindow) {
-      nsCOMPtr<mozIDOMWindowProxy> activeWindow;
+      nsCOMPtr<nsPIDOMWindowOuter> activeWindow;
       fm->GetActiveWindow(getter_AddRefs(activeWindow));
       if (activeWindow == rootWindow) {
         return eActiveWindow;
       }
     }
   }
 
   return eInactiveWindow;
--- a/dom/html/nsGenericHTMLFrameElement.cpp
+++ b/dom/html/nsGenericHTMLFrameElement.cpp
@@ -164,17 +164,17 @@ nsGenericHTMLFrameElement::CreateRemoteF
 NS_IMETHODIMP_(already_AddRefed<nsFrameLoader>)
 nsGenericHTMLFrameElement::GetFrameLoader()
 {
   RefPtr<nsFrameLoader> loader = mFrameLoader;
   return loader.forget();
 }
 
 void
-nsGenericHTMLFrameElement::PresetOpenerWindow(mozIDOMWindowProxy* aWindow, ErrorResult& aRv)
+nsGenericHTMLFrameElement::PresetOpenerWindow(nsPIDOMWindowOuter* aWindow, ErrorResult& aRv)
 {
   MOZ_ASSERT(!mFrameLoader);
   mOpenerWindow = nsPIDOMWindowOuter::From(aWindow);
 }
 
 void
 nsGenericHTMLFrameElement::InternalSetFrameLoader(nsFrameLoader* aNewFrameLoader)
 {
--- a/dom/html/nsGenericHTMLFrameElement.h
+++ b/dom/html/nsGenericHTMLFrameElement.h
@@ -74,17 +74,17 @@ public:
                         mozilla::ErrorResult& aError);
 
   void SwapFrameLoaders(nsXULElement& aOtherLoaderOwner,
                         mozilla::ErrorResult& aError);
 
   void SwapFrameLoaders(nsIFrameLoaderOwner* aOtherLoaderOwner,
                         mozilla::ErrorResult& rv);
 
-  void PresetOpenerWindow(mozIDOMWindowProxy* aOpenerWindow,
+  void PresetOpenerWindow(nsPIDOMWindowOuter* aOpenerWindow,
                           mozilla::ErrorResult& aRv);
 
   static void InitStatics();
   static bool BrowserFramesEnabled();
 
   /**
    * Helper method to map a HTML 'scrolling' attribute value to a nsIScrollable
    * enum value.  scrolling="no" (and its synonyms) maps to
--- a/dom/html/nsIFormSubmitObserver.idl
+++ b/dom/html/nsIFormSubmitObserver.idl
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 interface nsIURI;
 interface nsIArray;
 
 webidl HTMLFormElement;
 
 [scriptable, uuid(867cb7e7-835d-408b-9788-d2834d284e03)]
 interface nsIFormSubmitObserver: nsISupports
 {
-  void notify(in HTMLFormElement formNode, in mozIDOMWindow window, in nsIURI actionURL, out boolean cancelSubmit);
+  void notify(in HTMLFormElement formNode, in Window window, in nsIURI actionURL, out boolean cancelSubmit);
 
   void notifyInvalidSubmit(in HTMLFormElement formNode,
                            in nsIArray invalidElements);
 };
 
 %{C++
 #define NS_FORMSUBMIT_SUBJECT "formsubmit"
 #define NS_EARLYFORMSUBMIT_SUBJECT "earlyformsubmit"
--- a/dom/interfaces/base/nsIBrowserDOMWindow.idl
+++ b/dom/interfaces/base/nsIBrowserDOMWindow.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIDOMWindow;
 interface nsIURI;
 interface nsIFrameLoaderOwner;
 interface nsIPrincipal;
 
 [scriptable, uuid(e774db14-79ac-4156-a7a3-aa3fd0a22c10)]
 interface nsIOpenURIInFrameParams : nsISupports
 {
@@ -102,18 +102,18 @@ interface nsIBrowserDOMWindow : nsISuppo
    * @param aOpener window requesting the creation (can be null).
    * @param aFlags flags which control the behavior of the load. The
    *               OPEN_EXTERNAL/OPEN_NEW flag is only used when
    *               aWhere == OPEN_DEFAULTWINDOW.
    * @param aTriggeringPrincipal the principal that would trigger the potential
    *        load of aURI.
    * @return the window into which the URI would have been opened.
   */
-  mozIDOMWindowProxy
-  createContentWindow(in nsIURI aURI, in mozIDOMWindowProxy aOpener,
+  WindowProxy
+  createContentWindow(in nsIURI aURI, in WindowProxy aOpener,
                       in short aWhere, in long aFlags,
                       in nsIPrincipal aTriggeringPrincipal);
 
   /**
    * As above, but return the nsIFrameLoaderOwner for the new window.
    *
    * Additional Parameters:
    * @param aNextTabParentId The TabParent to associate the window with.
@@ -134,18 +134,18 @@ interface nsIBrowserDOMWindow : nsISuppo
    * @param aWhere see possible values described above.
    * @param aOpener window requesting the open (can be null).
    * @param aFlags flags which control the behavior of the load. The
    *               OPEN_EXTERNAL/OPEN_NEW flag is only used when
    *               aWhere == OPEN_DEFAULTWINDOW.
    * @param aTriggeringPrincipal the principal that triggered the load of aURI.
    * @return the window into which the URI was opened.
   */
-  mozIDOMWindowProxy
-  openURI(in nsIURI aURI, in mozIDOMWindowProxy aOpener,
+  WindowProxy
+  openURI(in nsIURI aURI, in WindowProxy aOpener,
           in short aWhere, in long aFlags, in nsIPrincipal aTriggeringPrincipal);
 
   /**
    * As above, but return the nsIFrameLoaderOwner for the new window.
    *
    * Additional Parameters:
    * @param aNextTabParentId The TabParent to associate the window with.
    * @param aName The name to give the window opened in the new tab.
--- a/dom/interfaces/base/nsIContentPermissionPrompt.idl
+++ b/dom/interfaces/base/nsIContentPermissionPrompt.idl
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIPrincipal;
-interface mozIDOMWindow;
+webidl Window;
 interface nsIArray;
 
 webidl Element;
 
 /**
  *  Interface provides the request type and its access.
  */
 [scriptable, uuid(ef4db3b8-ca9c-4b1d-8f81-fd88ec32af13)]
@@ -80,17 +80,17 @@ interface nsIContentPermissionRequest : 
   readonly attribute nsIPrincipal principal;
 
   /**
    *  The window or element that the permission request was
    *  originated in.  Typically the element will be non-null
    *  in when using out of process content.  window or
    *  element can be null but not both.
    */
-  readonly attribute mozIDOMWindow window;
+  readonly attribute Window window;
   readonly attribute Element element;
 
   readonly attribute boolean isHandlingUserInput;
 
   /**
    *  The requester to get the required information of
    *  the window.
    */
--- a/dom/interfaces/base/nsIDOMChromeWindow.idl
+++ b/dom/interfaces/base/nsIDOMChromeWindow.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 
 interface nsIBrowserDOMWindow;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 // Scriptable only so Components.interfaces.nsIDOMChromeWindow works.
 [scriptable, builtinclass, uuid(78bdcb41-1efa-409f-aaba-70842213f80f)]
 interface nsIDOMChromeWindow : nsISupports
 {
   /**
    * browserDOMWindow provides access to yet another layer of
    * utility functions implemented by chrome script. It will be null
--- a/dom/interfaces/base/nsIDOMGlobalPropertyInitializer.idl
+++ b/dom/interfaces/base/nsIDOMGlobalPropertyInitializer.idl
@@ -1,21 +1,21 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 
 [scriptable, uuid(5842e275-797f-4afb-b7e0-e29f0cb312ae)]
 interface nsIDOMGlobalPropertyInitializer : nsISupports
 {
   /*
    * Initialize the global property.
    *
    * @param window the global object on which the property is being retrieved.
    *
    * @returns a JS Object to use use as the property's value.
    */
-  jsval init(in mozIDOMWindow window);
+  jsval init(in Window window);
 };
--- a/dom/interfaces/base/nsIDOMWindowCollection.idl
+++ b/dom/interfaces/base/nsIDOMWindowCollection.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /**
  * The nsIDOMWindowCollection interface is an interface for a
  * collection of DOM window objects.
  */
 
 [uuid(8d64f457-fb8c-49ea-a359-cef30eed9774)]
 interface nsIDOMWindowCollection : nsISupports
@@ -18,15 +18,15 @@ interface nsIDOMWindowCollection : nsISu
   /**
    * Accessor for the number of windows in this collection.
    */
   readonly attribute unsigned long    length;
 
   /**
    * Method for accessing an item in this collection by index.
    */
-  mozIDOMWindowProxy        item(in unsigned long index);
+  WindowProxy        item(in unsigned long index);
 
   /**
    * Method for accessing an item in this collection by window name.
    */
-  mozIDOMWindowProxy        namedItem(in DOMString name);
+  WindowProxy        namedItem(in DOMString name);
 };
--- a/dom/interfaces/base/nsIFocusManager.idl
+++ b/dom/interfaces/base/nsIFocusManager.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIDocument;
 
 webidl Element;
 
 [scriptable, uuid(86e1f1e1-365d-493b-b52a-a649f3f311dc)]
 /**
  * The focus manager deals with all focus related behaviour. Only one element
  * in the entire application may have the focus at a time; this element
@@ -43,45 +43,45 @@ interface nsIFocusManager : nsISupports
 {
   /**
    * The most active (frontmost) window, or null if no window that is part of
    * the application is active. Setting the activeWindow raises it, and
    * focuses the current child window's current element, if any. Setting this
    * to null or to a non-top-level window throws an NS_ERROR_INVALID_ARG
    * exception.
    */
-  attribute mozIDOMWindowProxy activeWindow;
+  attribute WindowProxy activeWindow;
 
   /**
    * The child window within the activeWindow that is focused. This will
    * always be activeWindow, a child window of activeWindow or null if no
    * child window is focused. Setting the focusedWindow changes the focused
    * window and raises the toplevel window it is in. If the current focus
    * within the new focusedWindow is a frame element, then the focusedWindow
    * will actually be set to the child window and the current element within
    * that set as the focused element. This process repeats downwards until a
    * non-frame element is found.
    */
-  attribute mozIDOMWindowProxy focusedWindow;
+  attribute WindowProxy focusedWindow;
 
   /**
    * The element that is currently focused. This will always be an element
    * within the document loaded in focusedWindow or null if no element in that
    * document is focused.
    */
   readonly attribute Element focusedElement;
 
   /**
    * Returns the method that was used to focus the element in window. This
    * will either be 0, FLAG_BYMOUSE or FLAG_BYKEY. If window is null, then
    * the current focusedWindow will be used by default. This has the result
    * of retrieving the method that was used to focus the currently focused
    * element.
    */
-  uint32_t getLastFocusMethod(in mozIDOMWindowProxy window);
+  uint32_t getLastFocusMethod(in WindowProxy window);
 
   /**
    * Changes the focused element reference within the window containing
    * aElement to aElement.
    */
   void setFocus(in Element aElement, in unsigned long aFlags);
 
   /**
@@ -97,27 +97,27 @@ interface nsIFocusManager : nsISupports
    *
    * If no element is found, and aType is either MOVEFOCUS_ROOT or
    * MOVEFOCUS_CARET, then the focus is cleared. If aType is any other value,
    * the focus is not changed.
    *
    * Returns the element that was focused. The return value may be null if focus
    * was moved into a child process.
    */
-  Element moveFocus(in mozIDOMWindowProxy aWindow,
+  Element moveFocus(in WindowProxy aWindow,
                     in Element aStartElement,
                     in unsigned long aType, in unsigned long aFlags);
 
   /**
    * Clears the focused element within aWindow. If the current focusedWindow
    * is a descendant of aWindow, sets the current focusedWindow to aWindow.
    *
    * @throws NS_ERROR_INVALID_ARG if aWindow is null
    */
-  void clearFocus(in mozIDOMWindowProxy aWindow);
+  void clearFocus(in WindowProxy aWindow);
 
   /**
    * Returns the currently focused element within aWindow. If aWindow is equal
    * to the current value of focusedWindow, then the returned element will be
    * the application-wide focused element (the value of focusedElement). The
    * return value will be null if no element is focused.
    *
    * If aDeep is true, then child frames are traversed and the return value
@@ -126,24 +126,24 @@ interface nsIFocusManager : nsISupports
    * focus is in a child frame.
    *
    * aFocusedWindow will be set to the currently focused descendant window of
    * aWindow, or to aWindow if aDeep is false. This will be set even if no
    * element is focused.
    *
    * @throws NS_ERROR_INVALID_ARG if aWindow is null
    */
-  Element getFocusedElementForWindow(in mozIDOMWindowProxy aWindow,
+  Element getFocusedElementForWindow(in WindowProxy aWindow,
                                      in boolean aDeep,
-                                     out mozIDOMWindowProxy aFocusedWindow);
+                                     out WindowProxy aFocusedWindow);
 
   /**
    * Moves the selection caret within aWindow to the current focus.
    */
-  void moveCaretToFocus(in mozIDOMWindowProxy aWindow);
+  void moveCaretToFocus(in WindowProxy aWindow);
 
   /***
    * Check if given element is focusable.
    */
   boolean elementIsFocusable(in Element aElement, in unsigned long aFlags);
 
   /*
    * Raise the window when switching focus
@@ -229,37 +229,37 @@ interface nsIFocusManager : nsISupports
   /** move focus to the first focusable document */
   const unsigned long MOVEFOCUS_FIRSTDOC = 9;
   /** move focus to the last focusable document */
   const unsigned long MOVEFOCUS_LASTDOC = 10;
 
   /**
    * Called when a window has been raised.
    */
-  [noscript] void windowRaised(in mozIDOMWindowProxy aWindow);
+  [noscript] void windowRaised(in WindowProxy aWindow);
 
   /**
    * Called when a window has been lowered.
    */
-  [noscript] void windowLowered(in mozIDOMWindowProxy aWindow);
+  [noscript] void windowLowered(in WindowProxy aWindow);
 
   /**
    * Called when a new document in a window is shown.
    *
    * If aNeedsFocus is true, then focus events are expected to be fired on the
    * window if this window is in the focused window chain.
    */
-  [noscript] void windowShown(in mozIDOMWindowProxy aWindow,
+  [noscript] void windowShown(in WindowProxy aWindow,
                               in boolean aNeedsFocus);
 
   /**
    * Called when a document in a window has been hidden or otherwise can no
    * longer accept focus.
    */
-  [noscript] void windowHidden(in mozIDOMWindowProxy aWindow);
+  [noscript] void windowHidden(in WindowProxy aWindow);
 
   /**
    * Fire any events that have been delayed due to synchronized actions.
    */
   [noscript] void fireDelayedEvents(in nsIDocument aDocument);
 
   /**
    * Indicate that a plugin wishes to take the focus. This is similar to a
@@ -267,11 +267,11 @@ interface nsIFocusManager : nsISupports
    * widget focus state is the responsibility of the caller.
    */
   [noscript] void focusPlugin(in Element aPlugin);
 
   /**
    * Used in a child process to indicate that the parent window is now
    * active or deactive.
    */
-  [noscript] void parentActivated(in mozIDOMWindowProxy aWindow,
+  [noscript] void parentActivated(in WindowProxy aWindow,
                                   in bool active);
 };
--- a/dom/interfaces/base/nsIServiceWorkerManager.idl
+++ b/dom/interfaces/base/nsIServiceWorkerManager.idl
@@ -1,19 +1,19 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 #include "nsIRequest.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 interface nsPIDOMWindowInner;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIArray;
 interface nsIDocument;
 interface nsIInterceptedChannel;
 interface nsIPrincipal;
 interface nsIRunnable;
 interface nsIURI;
 %{C++
 namespace mozilla {
--- a/dom/interfaces/base/nsITextInputProcessor.idl
+++ b/dom/interfaces/base/nsITextInputProcessor.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 interface nsITextInputProcessorCallback;
 
 webidl Event;
 
 /**
  * An nsITextInputProcessor instance is associated with a top level widget which
  * handles native IME.  It's associated by calling beginInputTransaction() or
  * beginInputTransactionForTests().  While an instance has composition, nobody
@@ -274,29 +274,29 @@ interface nsITextInputProcessor : nsISup
    *                        IME and notifications to IME.  This must not be
    *                        null.
    * @return                If somebody uses internal text input service for a
    *                        composition, this returns false.  Otherwise, returns
    *                        true.  I.e., only your TIP can create composition
    *                        when this returns true.  If this returns false,
    *                        your TIP should wait next chance.
    */
-  boolean beginInputTransaction(in mozIDOMWindow aWindow,
+  boolean beginInputTransaction(in Window aWindow,
                                 in nsITextInputProcessorCallback aCallback);
 
   /**
    * When you create an instance for automated test, you must call
    * beginInputTransaction(), first.  See beginInputTransaction() for more
    * detail of this.
    * Note that aCallback can be null.  If it's null, nsITextInputProcessor
    * implementation will handle them automatically.
    */
   [optional_argc] boolean
     beginInputTransactionForTests(
-      in mozIDOMWindow aWindow,
+      in Window aWindow,
       [optional] in nsITextInputProcessorCallback aCallback);
 
   /**
    * startComposition() dispatches compositionstart event explicitly.
    * IME does NOT need to call this typically since compositionstart event
    * is automatically dispatched by sendPendingComposition() if
    * compositionstart event hasn't been dispatched yet.  If this is called
    * when compositionstart has already been dispatched, this throws an
--- a/dom/interfaces/storage/nsIDOMStorageManager.idl
+++ b/dom/interfaces/storage/nsIDOMStorageManager.idl
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIDOMStorage;
 interface nsIPrincipal;
-interface mozIDOMWindow;
+webidl Window;
 
 /**
  * General purpose interface that has two implementations, for localStorage
  * resp. sessionStorage with "@mozilla.org/dom/localStorage-manager;1" resp.
  * "@mozilla.org/dom/sessionStorage-manager;1" contract IDs.
  */
 [scriptable, uuid(a20c742e-3ed1-44fb-b897-4080a75b1662)]
 interface nsIDOMStorageManager : nsISupports
@@ -39,34 +39,34 @@ interface nsIDOMStorageManager : nsISupp
    *    The parent window.
    * @param aPrincipal
    *    Principal to bound storage to.
    * @param aDocumentURI
    *    URL of the demanding document, used for DOM storage event only.
    * @param aPrivate
    *    Whether the demanding document is running in Private Browsing mode or not.
    */
-  nsIDOMStorage createStorage(in mozIDOMWindow aWindow,
+  nsIDOMStorage createStorage(in Window aWindow,
                               in nsIPrincipal aPrincipal,
                               in DOMString aDocumentURI,
                               [optional] in bool aPrivate);
   /**
    * Returns instance of DOM storage object for given principal.
    * If there is no storage managed for the scope, then null is returned and
    * no object is created.  Otherwise, an object (new) for the existing storage
    * scope is returned.
    *
    * @param aWindow
    *    The parent window.
    * @param aPrincipal
    *    Principal to bound storage to.
    * @param aPrivate
    *    Whether the demanding document is running in Private Browsing mode or not.
    */
-  nsIDOMStorage getStorage(in mozIDOMWindow aWindow,
+  nsIDOMStorage getStorage(in Window aWindow,
                            in nsIPrincipal aPrincipal,
                            [optional] in bool aPrivate);
 
   /**
    * Clones given storage into this storage manager.
    *
    * @param aStorageToCloneFrom
    *    The storage to copy all items from into this manager.  Manager will then
--- a/dom/interfaces/xul/nsIDOMXULCommandDispatcher.idl
+++ b/dom/interfaces/xul/nsIDOMXULCommandDispatcher.idl
@@ -2,25 +2,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIController;
 interface nsIControllers;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 webidl Element;
 
 [scriptable, uuid(a9fa9fd3-8d62-4f94-9ed8-3ea9c3cf0773)]
 interface nsIDOMXULCommandDispatcher : nsISupports
 {
             attribute Element focusedElement;
-            attribute mozIDOMWindowProxy focusedWindow;
+            attribute WindowProxy focusedWindow;
 
   void                      addCommandUpdater(in Element updater,
                                               in DOMString events,
                                               in DOMString targets);
   void                      removeCommandUpdater(in Element updater);
 
   void                      updateCommands(in DOMString eventName);
 
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -738,37 +738,37 @@ ContentChild::SetProcessName(const nsASt
 #endif
   }
 
   mProcessName = aName;
   mozilla::ipc::SetThisProcessName(NS_LossyConvertUTF16toASCII(aName).get());
 }
 
 NS_IMETHODIMP
-ContentChild::ProvideWindow(mozIDOMWindowProxy* aParent,
+ContentChild::ProvideWindow(nsPIDOMWindowOuter* aParent,
                             uint32_t aChromeFlags,
                             bool aCalledFromJS,
                             bool aPositionSpecified,
                             bool aSizeSpecified,
                             nsIURI* aURI,
                             const nsAString& aName,
                             const nsACString& aFeatures,
                             bool aForceNoOpener,
                             nsIDocShellLoadInfo* aLoadInfo,
                             bool* aWindowIsNew,
-                            mozIDOMWindowProxy** aReturn)
+                            nsPIDOMWindowOuter** aReturn)
 {
   return ProvideWindowCommon(nullptr, aParent, false, aChromeFlags,
                              aCalledFromJS, aPositionSpecified,
                              aSizeSpecified, aURI, aName, aFeatures,
                              aForceNoOpener, aLoadInfo, aWindowIsNew, aReturn);
 }
 
 static nsresult
-GetCreateWindowParams(mozIDOMWindowProxy* aParent,
+GetCreateWindowParams(nsPIDOMWindowOuter* aParent,
                       nsIDocShellLoadInfo* aLoadInfo,
                       nsACString& aBaseURIString, float* aFullZoom,
                       uint32_t* aReferrerPolicy,
                       nsIPrincipal** aTriggeringPrincipal)
 {
   *aFullZoom = 1.0f;
   auto* opener = nsPIDOMWindowOuter::From(aParent);
   if (!opener) {
@@ -809,29 +809,29 @@ GetCreateWindowParams(mozIDOMWindowProxy
     cv->GetFullZoom(aFullZoom);
   }
 
   return NS_OK;
 }
 
 nsresult
 ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
-                                  mozIDOMWindowProxy* aParent,
+                                  nsPIDOMWindowOuter* aParent,
                                   bool aIframeMoz,
                                   uint32_t aChromeFlags,
                                   bool aCalledFromJS,
                                   bool aPositionSpecified,
                                   bool aSizeSpecified,
                                   nsIURI* aURI,
                                   const nsAString& aName,
                                   const nsACString& aFeatures,
                                   bool aForceNoOpener,
                                   nsIDocShellLoadInfo* aLoadInfo,
                                   bool* aWindowIsNew,
-                                  mozIDOMWindowProxy** aReturn)
+                                  nsPIDOMWindowOuter** aReturn)
 {
   *aReturn = nullptr;
 
   nsAutoPtr<IPCTabContext> ipcContext;
   TabId openerTabId = TabId(0);
   nsAutoCString features(aFeatures);
   nsAutoString name(aName);
 
@@ -1016,17 +1016,17 @@ ContentChild::ProvideWindowCommon(TabChi
     }
 
     newChild->SetMaxTouchPoints(maxTouchPoints);
 
     // Set the opener window for this window before we start loading the document
     // inside of it. We have to do this before loading the remote scripts, because
     // they can poke at the document and cause the nsDocument to be created before
     // the openerwindow
-    nsCOMPtr<mozIDOMWindowProxy> windowProxy = do_GetInterface(newChild->WebNavigation());
+    nsCOMPtr<nsPIDOMWindowOuter> windowProxy = do_GetInterface(newChild->WebNavigation());
     if (!aForceNoOpener && windowProxy && aParent) {
       nsPIDOMWindowOuter* outer = nsPIDOMWindowOuter::From(windowProxy);
       nsPIDOMWindowOuter* parent = nsPIDOMWindowOuter::From(aParent);
       outer->SetOpenerWindow(parent, *aWindowIsNew);
     }
 
     // Unfortunately we don't get a window unless we've shown the frame.  That's
     // pretty bogus; see bug 763602.
@@ -1041,17 +1041,17 @@ ContentChild::ProvideWindowCommon(TabChi
         MOZ_CRASH();
       }
     }
 
     if (!urlToLoad.IsEmpty()) {
       newChild->RecvLoadURL(urlToLoad, showInfo);
     }
 
-    nsCOMPtr<mozIDOMWindowProxy> win = do_GetInterface(newChild->WebNavigation());
+    nsCOMPtr<nsPIDOMWindowOuter> win = do_GetInterface(newChild->WebNavigation());
     win.forget(aReturn);
   };
 
   // NOTE: Capturing by reference here is safe, as this function won't return
   // until one of these callbacks is called.
   auto reject = [&] (ResponseRejectReason) {
     MOZ_RELEASE_ASSERT(NS_IsMainThread());
     NS_WARNING("windowCreated promise rejected");
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -99,29 +99,29 @@ public:
     nsCString name;
     nsCString UAName;
     nsCString ID;
     nsCString vendor;
   };
 
   nsresult
   ProvideWindowCommon(TabChild* aTabOpener,
-                      mozIDOMWindowProxy* aOpener,
+                      nsPIDOMWindowOuter* aOpener,
                       bool aIframeMoz,
                       uint32_t aChromeFlags,
                       bool aCalledFromJS,
                       bool aPositionSpecified,
                       bool aSizeSpecified,
                       nsIURI* aURI,
                       const nsAString& aName,
                       const nsACString& aFeatures,
                       bool aForceNoOpener,
                       nsIDocShellLoadInfo* aLoadInfo,
                       bool* aWindowIsNew,
-                      mozIDOMWindowProxy** aReturn);
+                      nsPIDOMWindowOuter** aReturn);
 
   bool Init(MessageLoop* aIOLoop,
             base::ProcessId aParentPid,
             const char* aParentBuildID,
             IPC::Channel* aChannel,
             uint64_t aChildID,
             bool aIsForBrowser);
 
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -4835,27 +4835,27 @@ ContentParent::CommonCreateWindow(PBrows
   // If we send it down in the non-async case, then we might set the
   // OriginAttributes after the document has already navigated.
   if (!aSetOpener) {
     Unused << TabParent::GetFrom(aNewTabParent)
       ->SendSetOriginAttributes(openerOriginAttributes);
   }
 
   if (aURIToLoad && aLoadURI) {
-    nsCOMPtr<mozIDOMWindowProxy> openerWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> openerWindow;
     if (aSetOpener && thisTabParent) {
       openerWindow = thisTabParent->GetParentWindowOuter();
     }
     nsCOMPtr<nsIBrowserDOMWindow> newBrowserDOMWin =
       TabParent::GetFrom(aNewTabParent)->GetBrowserDOMWindow();
     if (NS_WARN_IF(!newBrowserDOMWin)) {
       aResult = NS_ERROR_ABORT;
       return IPC_OK();
     }
-    nsCOMPtr<mozIDOMWindowProxy> win;
+    nsCOMPtr<nsPIDOMWindowOuter> win;
     aResult = newBrowserDOMWin->OpenURI(aURIToLoad, openerWindow,
                                         nsIBrowserDOMWindow::OPEN_CURRENTWINDOW,
                                         nsIBrowserDOMWindow::OPEN_NEW,
                                         aTriggeringPrincipal,
                                         getter_AddRefs(win));
   }
 
   return IPC_OK();
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -240,17 +240,17 @@ FilePickerParent::CreateFilePicker()
     return false;
   }
 
   Element* element = TabParent::GetFrom(Manager())->GetOwnerElement();
   if (!element) {
     return false;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> window = element->OwnerDoc()->GetWindow();
+  nsCOMPtr<nsPIDOMWindowOuter> window = element->OwnerDoc()->GetWindow();
   if (!window) {
     return false;
   }
 
   return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode));
 }
 
 mozilla::ipc::IPCResult
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -991,24 +991,24 @@ TabChild::GetInterface(const nsIID & aII
     }
 
     // XXXbz should we restrict the set of interfaces we hand out here?
     // See bug 537429
     return QueryInterface(aIID, aSink);
 }
 
 NS_IMETHODIMP
-TabChild::ProvideWindow(mozIDOMWindowProxy* aParent,
+TabChild::ProvideWindow(nsPIDOMWindowOuter* aParent,
                         uint32_t aChromeFlags,
                         bool aCalledFromJS,
                         bool aPositionSpecified, bool aSizeSpecified,
                         nsIURI* aURI, const nsAString& aName,
                         const nsACString& aFeatures, bool aForceNoOpener,
                         nsIDocShellLoadInfo* aLoadInfo, bool* aWindowIsNew,
-                        mozIDOMWindowProxy** aReturn)
+                        nsPIDOMWindowOuter** aReturn)
 {
     *aReturn = nullptr;
 
     // If aParent is inside an <iframe mozbrowser> and this isn't a request to
     // open a modal-type window, we're going to create a new <iframe mozbrowser>
     // and return its window here.
     nsCOMPtr<nsIDocShell> docshell = do_GetInterface(aParent);
     bool iframeMoz = (docshell && docshell->GetIsInMozBrowser() &&
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -515,25 +515,25 @@ public:
       return nullptr;
     }
 
     nsCOMPtr<nsITabChild> tc = aDocShell->GetTabChild();
     return static_cast<TabChild*>(tc.get());
   }
 
   static inline TabChild*
-  GetFrom(mozIDOMWindow* aWindow)
+  GetFrom(nsPIDOMWindowInner* aWindow)
   {
     nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
     nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
     return GetFrom(docShell);
   }
 
   static inline TabChild*
-  GetFrom(mozIDOMWindowProxy* aWindow)
+  GetFrom(nsPIDOMWindowOuter* aWindow)
   {
     nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
     nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
     return GetFrom(docShell);
   }
 
   static TabChild* GetFrom(nsIPresShell* aPresShell);
   static TabChild* GetFrom(layers::LayersId aLayersId);
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -867,17 +867,17 @@ void
 TabParent::Deactivate()
 {
   if (!mIsDestroyed) {
     Unused << Manager()->SendDeactivate(this);
   }
 }
 
 NS_IMETHODIMP
-TabParent::Init(mozIDOMWindowProxy *window)
+TabParent::Init(nsPIDOMWindowOuter *window)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetState(uint32_t *aState)
 {
   NS_ENSURE_ARG(aState);
@@ -3234,18 +3234,18 @@ public:
   NS_IMETHOD SetContentDispositionFilename(const nsAString&) NO_IMPL
   NS_IMETHOD GetContentDispositionHeader(nsACString&) NO_IMPL
   NS_IMETHOD OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo) override;
   NS_IMETHOD OnAuthCancelled(nsISupports *aContext, bool userCancel) override;
   NS_IMETHOD GetInterface(const nsIID & uuid, void **result) override
   {
     return QueryInterface(uuid, result);
   }
-  NS_IMETHOD GetAssociatedWindow(mozIDOMWindowProxy**) NO_IMPL
-  NS_IMETHOD GetTopWindow(mozIDOMWindowProxy**) NO_IMPL
+  NS_IMETHOD GetAssociatedWindow(nsPIDOMWindowOuter**) NO_IMPL
+  NS_IMETHOD GetTopWindow(nsPIDOMWindowOuter**) NO_IMPL
   NS_IMETHOD GetTopFrameElement(Element** aElement) override
   {
     nsCOMPtr<Element> elem = mElement;
     elem.forget(aElement);
     return NS_OK;
   }
   NS_IMETHOD GetNestedFrameId(uint64_t*) NO_IMPL
   NS_IMETHOD GetIsContent(bool*) NO_IMPL
--- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp
@@ -83,17 +83,17 @@ MediaEngineTabVideoSource::InitRunnable:
       }
     }
   }
   if (!mVideoSource->mWindow && !mVideoSource->mBlackedoutWindow) {
     nsresult rv;
     mVideoSource->mTabSource = do_GetService(NS_TABSOURCESERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCOMPtr<mozIDOMWindowProxy> win;
+    nsCOMPtr<nsPIDOMWindowOuter> win;
     rv = mVideoSource->mTabSource->GetTabToStream(getter_AddRefs(win));
     NS_ENSURE_SUCCESS(rv, rv);
     if (!win)
       return NS_OK;
 
     mVideoSource->mWindow = nsPIDOMWindowOuter::From(win);
     MOZ_ASSERT(mVideoSource->mWindow);
   }
--- a/dom/media/webrtc/nsITabSource.idl
+++ b/dom/media/webrtc/nsITabSource.idl
@@ -1,20 +1,20 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 [scriptable,uuid(0feba7f2-800d-4fe5-b28d-e3f17a7a7322)]
 interface nsITabSource : nsISupports
 {
-  mozIDOMWindowProxy getTabToStream();
-  void notifyStreamStart(in mozIDOMWindowProxy window);
-  void notifyStreamStop(in mozIDOMWindowProxy window);
+  WindowProxy getTabToStream();
+  void notifyStreamStart(in WindowProxy window);
+  void notifyStreamStop(in WindowProxy window);
 };
 
 %{C++
 #define NS_TABSOURCESERVICE_CONTRACTID "@mozilla.org/tab-source-service;1"
 %}
--- a/dom/media/webvtt/nsIWebVTTParserWrapper.idl
+++ b/dom/media/webvtt/nsIWebVTTParserWrapper.idl
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIWebVTTListener;
-interface mozIDOMWindow;
+webidl Window;
 interface nsIVariant;
 
 webidl DocumentFragment;
 
 /**
  * Interface for a wrapper of a JS WebVTT parser (vtt.js).
  */
 [scriptable, uuid(8dfe016e-1701-4618-9f5e-9a6154e853f0)]
@@ -20,17 +20,17 @@ interface nsIWebVTTParserWrapper : nsISu
    * Loads the JS WebVTTParser and sets it to use the passed window to create
    * VTTRegions and VTTCues. This function must be called before calling
    * parse, flush, or watch.
    *
    * @param window The window that the parser will use to create VTTCues and
    *               VTTRegions.
    *
    */
-  void loadParser(in mozIDOMWindow window);
+  void loadParser(in Window window);
 
   /**
    * Attempts to parse the stream's data as WebVTT format. When it successfully
    * parses a WebVTT region or WebVTT cue it will create a VTTRegion or VTTCue
    * object and pass it back to the callee through its callbacks.
    *
    * @param data   The buffer that contains the WebVTT data received by the
    *               Necko consumer so far.
@@ -56,17 +56,17 @@ interface nsIWebVTTParserWrapper : nsISu
    * Convert the text content of a WebVTT cue to a document fragment so that
    * we can display it on the page.
    *
    * @param window A window object with which the document fragment will be
    *               created.
    * @param cue    The cue whose content will be converted to a document
    *               fragment.
    */
-  DocumentFragment convertCueToDOMTree(in mozIDOMWindow window,
+  DocumentFragment convertCueToDOMTree(in Window window,
 				       in nsISupports cue);
 
 
   /**
    * Compute the display state of the VTTCues in cues along with any VTTRegions
    * that they might be in. First, it computes the positioning and styling of
    * the cues and regions passed and converts them into a DOM tree rooted at
    * a containing HTMLDivElement. It then adjusts those computed divs for
@@ -75,15 +75,15 @@ interface nsIWebVTTParserWrapper : nsISu
    *
    * @param window  A window object with which it will create the DOM tree
    *                and containing div element.
    * @param cues    An array of VTTCues who need there display state to be
    *                computed.
    * @param overlay The HTMLElement that the cues will be displayed within.
    * @param controls The video control element that will affect cues position.
    */
-  void processCues(in mozIDOMWindow window, in nsIVariant cues,
+  void processCues(in Window window, in nsIVariant cues,
                    in nsISupports overlay, in nsISupports controls);
 };
 
 %{C++
 #define NS_WEBVTTPARSERWRAPPER_CONTRACTID "@mozilla.org/webvttParserWrapper;1"
 %}
--- a/dom/midi/MIDIPermissionRequest.cpp
+++ b/dom/midi/MIDIPermissionRequest.cpp
@@ -78,17 +78,17 @@ NS_IMETHODIMP
 MIDIPermissionRequest::GetPrincipal(nsIPrincipal** aRequestingPrincipal)
 {
   NS_ENSURE_ARG_POINTER(aRequestingPrincipal);
   NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-MIDIPermissionRequest::GetWindow(mozIDOMWindow** aRequestingWindow)
+MIDIPermissionRequest::GetWindow(nsPIDOMWindowInner** aRequestingWindow)
 {
   NS_ENSURE_ARG_POINTER(aRequestingWindow);
   NS_IF_ADDREF(*aRequestingWindow = mWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 MIDIPermissionRequest::GetElement(Element** aRequestingElement)
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -582,17 +582,17 @@ NotificationPermissionRequest::Run()
 NS_IMETHODIMP
 NotificationPermissionRequest::GetPrincipal(nsIPrincipal** aRequestingPrincipal)
 {
   NS_ADDREF(*aRequestingPrincipal = mPrincipal);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-NotificationPermissionRequest::GetWindow(mozIDOMWindow** aRequestingWindow)
+NotificationPermissionRequest::GetWindow(nsPIDOMWindowInner** aRequestingWindow)
 {
   NS_ADDREF(*aRequestingWindow = mWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 NotificationPermissionRequest::GetElement(Element** aElement)
 {
--- a/dom/plugins/ipc/PluginHangUIParent.cpp
+++ b/dom/plugins/ipc/PluginHangUIParent.cpp
@@ -385,17 +385,17 @@ PluginHangUIParent::GetHangUIOwnerWindow
 {
   windowHandle = nullptr;
 
   nsresult rv;
   nsCOMPtr<nsIWindowMediator> winMediator(do_GetService(NS_WINDOWMEDIATOR_CONTRACTID,
                                                         &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<mozIDOMWindowProxy> navWin;
+  nsCOMPtr<nsPIDOMWindowOuter> navWin;
   rv = winMediator->GetMostRecentWindow(u"navigator:browser",
                                         getter_AddRefs(navWin));
   NS_ENSURE_SUCCESS(rv, rv);
   if (!navWin) {
     return NS_ERROR_FAILURE;
   }
 
   nsPIDOMWindowOuter* win = nsPIDOMWindowOuter::From(navWin);
--- a/dom/power/PowerManagerService.cpp
+++ b/dom/power/PowerManagerService.cpp
@@ -133,17 +133,17 @@ PowerManagerService::NewWakeLock(const n
     return nullptr;
   }
 
   return wakelock.forget();
 }
 
 NS_IMETHODIMP
 PowerManagerService::NewWakeLock(const nsAString &aTopic,
-                                 mozIDOMWindow *aWindow,
+                                 nsPIDOMWindowInner *aWindow,
                                  nsISupports **aWakeLock)
 {
   mozilla::ErrorResult rv;
   RefPtr<WakeLock> wakelock =
     NewWakeLock(aTopic, nsPIDOMWindowInner::From(aWindow), rv);
   if (rv.Failed()) {
     return rv.StealNSResult();
   }
--- a/dom/power/nsIPowerManagerService.idl
+++ b/dom/power/nsIPowerManagerService.idl
@@ -6,27 +6,27 @@
 #include "nsISupports.idl"
 
 %{C++
 #define NS_POWERMANAGERSERVICE_CID { 0x18c2e238, 0x3a0a, 0x4153, {0x89, 0xfc, 0x16, 0x6b, 0x3b, 0x14, 0x65, 0xa1 } }
 #define POWERMANAGERSERVICE_CONTRACTID "@mozilla.org/power/powermanagerservice;1"
 %}
 
 interface nsIDOMMozWakeLockListener;
-interface mozIDOMWindow;
+webidl Window;
 
 /**
  * For use with non-content code.
  */
 [scriptable, builtinclass, uuid(ba7ca4c1-9d92-4425-a83b-85dd7fa953f7)]
 interface nsIPowerManagerService : nsISupports
 {
   void              addWakeLockListener(in nsIDOMMozWakeLockListener aListener);
   void              removeWakeLockListener(in nsIDOMMozWakeLockListener aListener);
   DOMString         getWakeLockState(in DOMString aTopic);
 
   /**
    * Return a wake lock (MozWakeLock) object of aTopic associated with aWindow.
    * A wake lock without associated window, e.g. used in chrome, is
    * always considered invisible.
    */
-  nsISupports newWakeLock(in DOMString aTopic, [optional] in mozIDOMWindow aWindow);
+  nsISupports newWakeLock(in DOMString aTopic, [optional] in Window aWindow);
 };
--- a/dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl
+++ b/dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIPresentationChannelDescription;
 interface nsISocketTransport;
-interface mozIDOMWindow;
+webidl Window;
 interface nsIPresentationControlChannel;
 interface nsIPresentationSessionTransport;
 
 [scriptable, uuid(673f6de1-e253-41b8-9be8-b7ff161fa8dc)]
 interface nsIPresentationSessionTransportBuilderListener : nsISupports
 {
   // Should set |transport.callback| in |onSessionTransport|.
   void onSessionTransport(in nsIPresentationSessionTransport transport);
@@ -64,17 +64,17 @@ interface nsIPresentationDataChannelSess
   /**
    * The following creation function will trigger |listener.onSessionTransport|
    * if the session transport is successfully built, |listener.onError| if some
    * error occurs during creating session transport. The |notifyConnected| of
    * |aControlChannel| should be called before calling
    * |buildDataChannelTransport|.
    */
   void buildDataChannelTransport(in uint8_t aRole,
-                                 in mozIDOMWindow aWindow,
+                                 in Window aWindow,
                                  in nsIPresentationSessionTransportBuilderListener aListener);
 
   // Bug 1275150 - Merge TCP builder with the following APIs
   void onOffer(in nsIPresentationChannelDescription offer);
   void onAnswer(in nsIPresentationChannelDescription answer);
   void onIceCandidate(in DOMString candidate);
   void notifyDisconnected(in nsresult reason);
 };
--- a/dom/presentation/ipc/PresentationBuilderParent.cpp
+++ b/dom/presentation/ipc/PresentationBuilderParent.cpp
@@ -117,17 +117,17 @@ PresentationBuilderParent::~Presentation
   if (mNeedDestroyActor) {
     Unused << NS_WARN_IF(!Send__delete__(this));
   }
 }
 
 NS_IMETHODIMP
 PresentationBuilderParent::BuildDataChannelTransport(
                       uint8_t aRole,
-                      mozIDOMWindow* aWindow, /* unused */
+                      nsPIDOMWindowInner* aWindow, /* unused */
                       nsIPresentationSessionTransportBuilderListener* aListener)
 {
   mBuilderListener = aListener;
 
   RefPtr<PresentationSessionInfo> info = static_cast<PresentationSessionInfo*>(aListener);
   nsAutoString sessionId(info->GetSessionId());
   if (NS_WARN_IF(!mParent->SendPPresentationBuilderConstructor(this,
                                                                sessionId,
--- a/dom/quota/StorageManager.cpp
+++ b/dom/quota/StorageManager.cpp
@@ -725,17 +725,17 @@ PersistentStoragePermissionRequest::GetP
 NS_IMETHODIMP
 PersistentStoragePermissionRequest::GetIsHandlingUserInput(bool* aIsHandlingUserInput)
 {
   *aIsHandlingUserInput = mIsHandlingUserInput;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-PersistentStoragePermissionRequest::GetWindow(mozIDOMWindow** aRequestingWindow)
+PersistentStoragePermissionRequest::GetWindow(nsPIDOMWindowInner** aRequestingWindow)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aRequestingWindow);
   MOZ_ASSERT(mWindow);
 
   NS_ADDREF(*aRequestingWindow = mWindow);
 
   return NS_OK;
--- a/dom/storage/LocalStorageManager.cpp
+++ b/dom/storage/LocalStorageManager.cpp
@@ -203,17 +203,17 @@ LocalStorageManager::DropCache(LocalStor
   }
 
   CacheOriginHashtable* table = mCaches.LookupOrAdd(aCache->OriginSuffix());
   table->RemoveEntry(aCache->OriginNoSuffix());
 }
 
 nsresult
 LocalStorageManager::GetStorageInternal(CreateMode aCreateMode,
-                                        mozIDOMWindow* aWindow,
+                                        nsPIDOMWindowInner* aWindow,
                                         nsIPrincipal* aPrincipal,
                                         const nsAString& aDocumentURI,
                                         bool aPrivate,
                                         nsIDOMStorage** aRetval)
 {
   nsAutoCString originAttrSuffix;
   nsAutoCString originKey;
 
@@ -266,28 +266,28 @@ NS_IMETHODIMP
 LocalStorageManager::PrecacheStorage(nsIPrincipal* aPrincipal,
                                      nsIDOMStorage** aRetval)
 {
   return GetStorageInternal(CreateMode::CreateIfShouldPreload, nullptr,
                             aPrincipal, EmptyString(), false, aRetval);
 }
 
 NS_IMETHODIMP
-LocalStorageManager::CreateStorage(mozIDOMWindow* aWindow,
+LocalStorageManager::CreateStorage(nsPIDOMWindowInner* aWindow,
                                    nsIPrincipal* aPrincipal,
                                    const nsAString& aDocumentURI,
                                    bool aPrivate,
                                    nsIDOMStorage** aRetval)
 {
   return GetStorageInternal(CreateMode::CreateAlways, aWindow, aPrincipal,
                             aDocumentURI, aPrivate, aRetval);
 }
 
 NS_IMETHODIMP
-LocalStorageManager::GetStorage(mozIDOMWindow* aWindow,
+LocalStorageManager::GetStorage(nsPIDOMWindowInner* aWindow,
                                 nsIPrincipal* aPrincipal,
                                 bool aPrivate,
                                 nsIDOMStorage** aRetval)
 {
   return GetStorageInternal(CreateMode::UseIfExistsNeverCreate, aWindow,
                             aPrincipal, EmptyString(), aPrivate, aRetval);
 }
 
--- a/dom/storage/LocalStorageManager.h
+++ b/dom/storage/LocalStorageManager.h
@@ -95,17 +95,17 @@ private:
     // CreateStorage: Create it if it's not already in memory.
     CreateAlways,
     // PrecacheStorage: Create only if the database says we ShouldPreloadOrigin.
     CreateIfShouldPreload
   };
 
   // Helper for creation of DOM storage objects
   nsresult GetStorageInternal(CreateMode aCreate,
-                              mozIDOMWindow* aWindow,
+                              nsPIDOMWindowInner* aWindow,
                               nsIPrincipal* aPrincipal,
                               const nsAString& aDocumentURI,
                               bool aPrivate,
                               nsIDOMStorage** aRetval);
 
   // Suffix->origin->cache map
   typedef nsTHashtable<LocalStorageCacheHashKey> CacheOriginHashtable;
   nsClassHashtable<nsCStringHashKey, CacheOriginHashtable> mCaches;
--- a/dom/storage/SessionStorageManager.cpp
+++ b/dom/storage/SessionStorageManager.cpp
@@ -39,17 +39,17 @@ NS_IMETHODIMP
 SessionStorageManager::PrecacheStorage(nsIPrincipal* aPrincipal,
                                        nsIDOMStorage** aRetval)
 {
   // Nothing to preload.
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SessionStorageManager::CreateStorage(mozIDOMWindow* aWindow,
+SessionStorageManager::CreateStorage(nsPIDOMWindowInner* aWindow,
                                      nsIPrincipal* aPrincipal,
                                      const nsAString& aDocumentURI,
                                      bool aPrivate,
                                      nsIDOMStorage** aRetval)
 {
   nsAutoCString originKey;
   nsAutoCString originAttributes;
   nsresult rv = GenerateOriginKey(aPrincipal, originAttributes, originKey);
@@ -74,17 +74,17 @@ SessionStorageManager::CreateStorage(moz
   RefPtr<SessionStorage> storage =
     new SessionStorage(inner, aPrincipal, cache, this, aDocumentURI, aPrivate);
 
   storage.forget(aRetval);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-SessionStorageManager::GetStorage(mozIDOMWindow* aWindow,
+SessionStorageManager::GetStorage(nsPIDOMWindowInner* aWindow,
                                   nsIPrincipal* aPrincipal,
                                   bool aPrivate,
                                   nsIDOMStorage** aRetval)
 {
   *aRetval = nullptr;
 
   nsAutoCString originKey;
   nsAutoCString originAttributes;
--- a/dom/workers/WorkerDebugger.cpp
+++ b/dom/workers/WorkerDebugger.cpp
@@ -288,17 +288,17 @@ WorkerDebugger::GetUrl(nsAString& aResul
     return NS_ERROR_UNEXPECTED;
   }
 
   aResult = mWorkerPrivate->ScriptURL();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-WorkerDebugger::GetWindow(mozIDOMWindow** aResult)
+WorkerDebugger::GetWindow(nsPIDOMWindowInner** aResult)
 {
   AssertIsOnMainThread();
 
   if (!mWorkerPrivate) {
     return NS_ERROR_UNEXPECTED;
   }
 
   if (mWorkerPrivate->GetParent() || !mWorkerPrivate->IsDedicatedWorker()) {
--- a/dom/workers/nsIWorkerDebugger.idl
+++ b/dom/workers/nsIWorkerDebugger.idl
@@ -1,11 +1,11 @@
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 interface nsIPrincipal;
 
 [scriptable, uuid(9cf3b48e-361d-486a-8917-55cf8d00bb41)]
 interface nsIWorkerDebuggerListener : nsISupports
 {
   void onClose();
 
   void onError(in DOMString filename, in unsigned long lineno,
@@ -28,17 +28,17 @@ interface nsIWorkerDebugger : nsISupport
   readonly attribute bool isInitialized;
 
   readonly attribute nsIWorkerDebugger parent;
 
   readonly attribute unsigned long type;
 
   readonly attribute DOMString url;
 
-  readonly attribute mozIDOMWindow window;
+  readonly attribute Window window;
 
   readonly attribute nsIPrincipal principal;
 
   readonly attribute unsigned long serviceWorkerID;
 
   void initialize(in DOMString url);
 
   [binaryname(PostMessageMoz)]
--- a/dom/xbl/nsXBLWindowKeyHandler.cpp
+++ b/dom/xbl/nsXBLWindowKeyHandler.cpp
@@ -588,17 +588,17 @@ nsXBLWindowKeyHandler::HandleEventOnCapt
 
 bool
 nsXBLWindowKeyHandler::IsHTMLEditableFieldFocused()
 {
   nsFocusManager* fm = nsFocusManager::GetFocusManager();
   if (!fm)
     return false;
 
-  nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
   fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
   if (!focusedWindow)
     return false;
 
   auto* piwin = nsPIDOMWindowOuter::From(focusedWindow);
   nsIDocShell *docShell = piwin->GetDocShell();
   if (!docShell) {
     return false;
--- a/dom/xul/nsXULCommandDispatcher.cpp
+++ b/dom/xul/nsXULCommandDispatcher.cpp
@@ -136,17 +136,17 @@ nsXULCommandDispatcher::GetFocusedElemen
     }
   }
 
   focusedContent.forget(aElement);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULCommandDispatcher::GetFocusedWindow(mozIDOMWindowProxy** aWindow)
+nsXULCommandDispatcher::GetFocusedWindow(nsPIDOMWindowOuter** aWindow)
 {
   *aWindow = nullptr;
 
   nsCOMPtr<nsPIDOMWindowOuter> window;
   GetRootFocusedContentAndWindow(getter_AddRefs(window));
   if (!window)
     return NS_OK;
 
@@ -175,17 +175,17 @@ nsXULCommandDispatcher::SetFocusedElemen
 
   // if aElement is null, clear the focus in the currently focused child window
   nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
   GetRootFocusedContentAndWindow(getter_AddRefs(focusedWindow));
   return fm->ClearFocus(focusedWindow);
 }
 
 NS_IMETHODIMP
-nsXULCommandDispatcher::SetFocusedWindow(mozIDOMWindowProxy* aWindow)
+nsXULCommandDispatcher::SetFocusedWindow(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(aWindow, NS_OK); // do nothing if set to null
 
   nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
   NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
 
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1510,17 +1510,17 @@ nsXULElement::GetFrameLoader()
     if (!slots)
         return nullptr;
 
     RefPtr<nsFrameLoader> loader = do_QueryObject(slots->mFrameLoaderOrOpener);
     return loader.forget();
 }
 
 void
-nsXULElement::PresetOpenerWindow(mozIDOMWindowProxy* aWindow, ErrorResult& aRv)
+nsXULElement::PresetOpenerWindow(nsPIDOMWindowOuter* aWindow, ErrorResult& aRv)
 {
     nsExtendedDOMSlots* slots = ExtendedDOMSlots();
     MOZ_ASSERT(!slots->mFrameLoaderOrOpener, "A frameLoader or opener is present when calling PresetOpenerWindow");
 
     slots->mFrameLoaderOrOpener = aWindow;
 }
 
 void
--- a/dom/xul/nsXULElement.h
+++ b/dom/xul/nsXULElement.h
@@ -396,17 +396,17 @@ public:
     virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute,
                                                 int32_t aModType) const override;
     NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
 
     virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                            bool aPreallocateChildren) const override;
     virtual mozilla::EventStates IntrinsicState() const override;
 
-    void PresetOpenerWindow(mozIDOMWindowProxy* aWindow, ErrorResult& aRv);
+    void PresetOpenerWindow(nsPIDOMWindowOuter* aWindow, ErrorResult& aRv);
 
     virtual void RecompileScriptEventListeners() override;
 
     // This function should ONLY be used by BindToTree implementations.
     // The function exists solely because XUL elements store the binding
     // parent as a member instead of in the slots, as Element does.
     void SetXULBindingParent(nsIContent* aBindingParent)
     {
--- a/editor/composer/nsEditingSession.cpp
+++ b/editor/composer/nsEditingSession.cpp
@@ -102,17 +102,17 @@ NS_IMPL_ISUPPORTS(nsEditingSession, nsIE
   void makeWindowEditable(in nsIDOMWindow aWindow, in string aEditorType,
                           in boolean aDoAfterUriLoad,
                           in boolean aMakeWholeDocumentEditable,
                           in boolean aInteractive);
 ----------------------------------------------------------------------------*/
 #define DEFAULT_EDITOR_TYPE "html"
 
 NS_IMETHODIMP
-nsEditingSession::MakeWindowEditable(mozIDOMWindowProxy* aWindow,
+nsEditingSession::MakeWindowEditable(nsPIDOMWindowOuter* aWindow,
                                      const char *aEditorType,
                                      bool aDoAfterUriLoad,
                                      bool aMakeWholeDocumentEditable,
                                      bool aInteractive)
 {
   mEditorType.Truncate();
   mEditorFlags = 0;
 
@@ -180,17 +180,17 @@ nsEditingSession::MakeWindowEditable(moz
     if (NS_FAILED(rv)) {
       TearDownEditorOnWindow(aWindow);
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP
-nsEditingSession::DisableJSAndPlugins(mozIDOMWindowProxy* aWindow)
+nsEditingSession::DisableJSAndPlugins(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(aWindow, NS_ERROR_FAILURE);
   nsIDocShell *docShell = nsPIDOMWindowOuter::From(aWindow)->GetDocShell();
   NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
 
   bool tmp;
   nsresult rv = docShell->GetAllowJavascript(&tmp);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -207,17 +207,17 @@ nsEditingSession::DisableJSAndPlugins(mo
   NS_ENSURE_SUCCESS(rv, rv);
 
   mDisabledJSAndPlugins = true;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsEditingSession::RestoreJSAndPlugins(mozIDOMWindowProxy* aWindow)
+nsEditingSession::RestoreJSAndPlugins(nsPIDOMWindowOuter* aWindow)
 {
   if (!mDisabledJSAndPlugins) {
     return NS_OK;
   }
 
   mDisabledJSAndPlugins = false;
 
   NS_ENSURE_TRUE(aWindow, NS_ERROR_FAILURE);
@@ -241,17 +241,17 @@ nsEditingSession::GetJsAndPluginsDisable
 
 /*---------------------------------------------------------------------------
 
   WindowIsEditable
 
   boolean windowIsEditable (in nsIDOMWindow aWindow);
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
-nsEditingSession::WindowIsEditable(mozIDOMWindowProxy* aWindow,
+nsEditingSession::WindowIsEditable(nsPIDOMWindowOuter* aWindow,
                                    bool *outIsEditable)
 {
   NS_ENSURE_STATE(aWindow);
   nsCOMPtr<nsIDocShell> docShell = nsPIDOMWindowOuter::From(aWindow)->GetDocShell();
   NS_ENSURE_STATE(docShell);
 
   return docShell->GetEditable(outIsEditable);
 }
@@ -293,17 +293,17 @@ IsSupportedTextType(const char* aMIMETyp
 
 /*---------------------------------------------------------------------------
 
   SetupEditorOnWindow
 
   nsIEditor setupEditorOnWindow (in nsIDOMWindow aWindow);
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
-nsEditingSession::SetupEditorOnWindow(mozIDOMWindowProxy* aWindow)
+nsEditingSession::SetupEditorOnWindow(nsPIDOMWindowOuter* aWindow)
 {
   mDoneSetup = true;
 
   NS_ENSURE_TRUE(aWindow, NS_ERROR_FAILURE);
   auto* window = nsPIDOMWindowOuter::From(aWindow);
 
   nsresult rv;
 
@@ -508,17 +508,17 @@ nsEditingSession::RemoveListenersAndCont
 
 /*---------------------------------------------------------------------------
 
   TearDownEditorOnWindow
 
   void tearDownEditorOnWindow (in nsIDOMWindow aWindow);
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
-nsEditingSession::TearDownEditorOnWindow(mozIDOMWindowProxy *aWindow)
+nsEditingSession::TearDownEditorOnWindow(nsPIDOMWindowOuter *aWindow)
 {
   if (!mDoneSetup) {
     return NS_OK;
   }
 
   NS_ENSURE_TRUE(aWindow, NS_ERROR_NULL_POINTER);
 
   // Kill any existing reload timer
@@ -578,17 +578,17 @@ nsEditingSession::TearDownEditorOnWindow
 
 /*---------------------------------------------------------------------------
 
   GetEditorForFrame
 
   nsIEditor getEditorForFrame (in nsIDOMWindow aWindow);
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
-nsEditingSession::GetEditorForWindow(mozIDOMWindowProxy* aWindow,
+nsEditingSession::GetEditorForWindow(nsPIDOMWindowOuter* aWindow,
                                      nsIEditor **outEditor)
 {
   if (NS_WARN_IF(!aWindow)) {
     return NS_ERROR_INVALID_ARG;
   }
   nsCOMPtr<nsIEditor> editor = GetHTMLEditorForWindow(aWindow);
   editor.forget(outEditor);
   return NS_OK;
@@ -652,17 +652,17 @@ nsEditingSession::OnStateChange(nsIWebPr
 #ifdef NOISY_DOC_LOADING
       printf("STATE_START & STATE_IS_DOCUMENT flags=%x\n", aStateFlags);
 #endif
 
       bool progressIsForTargetDocument =
         IsProgressForTargetDocument(aWebProgress);
 
       if (progressIsForTargetDocument) {
-        nsCOMPtr<mozIDOMWindowProxy> window;
+        nsCOMPtr<nsPIDOMWindowOuter> window;
         aWebProgress->GetDOMWindow(getter_AddRefs(window));
 
         auto* piWindow = nsPIDOMWindowOuter::From(window);
         nsCOMPtr<nsIDocument> doc = piWindow->GetDoc();
         nsHTMLDocument* htmlDoc = doc && doc->IsHTMLOrXHTML()
           ? doc->AsHTMLDocument() : nullptr;
         if (htmlDoc && htmlDoc->IsWriting()) {
           nsAutoString designMode;
@@ -764,17 +764,17 @@ nsEditingSession::OnProgressChange(nsIWe
   OnLocationChange
 
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
 nsEditingSession::OnLocationChange(nsIWebProgress *aWebProgress,
                                    nsIRequest *aRequest, nsIURI *aURI,
                                    uint32_t aFlags)
 {
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   nsresult rv = aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
   NS_ENSURE_SUCCESS(rv, rv);
 
   auto* piWindow = nsPIDOMWindowOuter::From(domWindow);
 
   nsCOMPtr<nsIDocument> doc = piWindow->GetDoc();
   NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
 
@@ -900,17 +900,17 @@ nsEditingSession::EndDocumentLoad(nsIWeb
   }
 #endif
 
   // We want to call the base class EndDocumentLoad,
   // but avoid some of the stuff
   // that nsDocShell does (need to refactor).
 
   // OK, time to make an editor on this document
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
   NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
 
   // Set the error state -- we will create an editor
   // anyway and load empty doc later
   if (aIsToBeMadeEditable && aStatus == NS_ERROR_FILE_NOT_FOUND) {
     mEditorStatus = eEditorErrorFileNotFound;
   }
@@ -1030,17 +1030,17 @@ nsEditingSession::EndPageLoad(nsIWebProg
 #endif
 
   // Set the error state -- we will create an editor anyway
   // and load empty doc later
   if (aStatus == NS_ERROR_FILE_NOT_FOUND) {
     mEditorStatus = eEditorErrorFileNotFound;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
 
   nsIDocShell *docShell =
     domWindow ? nsPIDOMWindowOuter::From(domWindow)->GetDocShell() : nullptr;
   NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
 
   // cancel refresh from meta tags
   // we need to make sure that all pages in editor (whether editable or not)
@@ -1093,17 +1093,17 @@ nsEditingSession::PrepareForEditing(nsPI
   SetupEditorCommandController
 
   Create a command controller, append to controllers,
   get and return the controller ID, and set the context
 ----------------------------------------------------------------------------*/
 nsresult
 nsEditingSession::SetupEditorCommandController(
                                   const char *aControllerClassName,
-                                  mozIDOMWindowProxy *aWindow,
+                                  nsPIDOMWindowOuter *aWindow,
                                   nsISupports *aContext,
                                   uint32_t *aControllerId)
 {
   NS_ENSURE_ARG_POINTER(aControllerClassName);
   NS_ENSURE_ARG_POINTER(aWindow);
   NS_ENSURE_ARG_POINTER(aContext);
   NS_ENSURE_ARG_POINTER(aControllerId);
 
@@ -1138,17 +1138,17 @@ nsEditingSession::SetupEditorCommandCont
 
 /*---------------------------------------------------------------------------
 
   SetEditorOnControllers
 
   Set the editor on the controller(s) for this window
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
-nsEditingSession::SetEditorOnControllers(mozIDOMWindowProxy* aWindow,
+nsEditingSession::SetEditorOnControllers(nsPIDOMWindowOuter* aWindow,
                                          nsIEditor* aEditor)
 {
   NS_ENSURE_TRUE(aWindow, NS_ERROR_NULL_POINTER);
 
   auto* piWindow = nsPIDOMWindowOuter::From(aWindow);
 
   nsCOMPtr<nsIControllers> controllers;
   nsresult rv = piWindow->GetControllers(getter_AddRefs(controllers));
@@ -1262,17 +1262,17 @@ nsEditingSession::RestoreAnimationMode(n
   NS_ENSURE_TRUE_VOID(presShell);
   nsPresContext* presContext = presShell->GetPresContext();
   NS_ENSURE_TRUE_VOID(presContext);
 
   presContext->SetImageAnimationMode(mImageAnimationMode);
 }
 
 nsresult
-nsEditingSession::DetachFromWindow(mozIDOMWindowProxy* aWindow)
+nsEditingSession::DetachFromWindow(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(mDoneSetup, NS_OK);
 
   NS_ASSERTION(mComposerCommandsUpdater,
                "mComposerCommandsUpdater should exist.");
 
   // Kill any existing reload timer
   if (mLoadBlankDocTimer) {
@@ -1292,17 +1292,17 @@ nsEditingSession::DetachFromWindow(mozID
   // Kill our weak reference to our original window, in case
   // it changes on restore, or otherwise dies.
   mDocShell = nullptr;
 
   return NS_OK;
 }
 
 nsresult
-nsEditingSession::ReattachToWindow(mozIDOMWindowProxy* aWindow)
+nsEditingSession::ReattachToWindow(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(mDoneSetup, NS_OK);
   NS_ENSURE_TRUE(aWindow, NS_ERROR_FAILURE);
 
   NS_ASSERTION(mComposerCommandsUpdater,
                "mComposerCommandsUpdater should exist.");
 
   // Imitate nsEditorDocShell::MakeEditable() to reattach the
@@ -1380,17 +1380,17 @@ nsEditingSession::ReattachToWindow(mozID
     NS_ASSERTION(isEditable, "Window is not editable after reattaching editor.");
   }
 #endif // DEBUG
 
   return NS_OK;
 }
 
 HTMLEditor*
-nsIEditingSession::GetHTMLEditorForWindow(mozIDOMWindowProxy* aWindow)
+nsIEditingSession::GetHTMLEditorForWindow(nsPIDOMWindowOuter* aWindow)
 {
   if (NS_WARN_IF(!aWindow)) {
     return nullptr;
   }
 
   nsCOMPtr<nsIDocShell> docShell =
     nsPIDOMWindowOuter::From(aWindow)->GetDocShell();
   if (NS_WARN_IF(!docShell)) {
--- a/editor/composer/nsEditingSession.h
+++ b/editor/composer/nsEditingSession.h
@@ -22,17 +22,17 @@
 #endif
 
 #ifndef __gen_nsIEditingSession_h__
 #include "nsIEditingSession.h"          // for NS_DECL_NSIEDITINGSESSION, etc
 #endif
 
 #include "nsString.h"                   // for nsCString
 
-class mozIDOMWindowProxy;
+class nsPIDOMWindowOuter;
 class nsIDOMWindow;
 class nsISupports;
 class nsITimer;
 
 #define NS_EDITINGSESSION_CID                            \
 { 0xbc26ff01, 0xf2bd, 0x11d4, { 0xa7, 0x3c, 0xe5, 0xa4, 0xb5, 0xa8, 0xbd, 0xfc } }
 
 
@@ -63,17 +63,17 @@ public:
 
   // nsIEditingSession
   NS_DECL_NSIEDITINGSESSION
 
 protected:
   virtual         ~nsEditingSession();
 
   nsresult        SetupEditorCommandController(const char *aControllerClassName,
-                                               mozIDOMWindowProxy* aWindow,
+                                               nsPIDOMWindowOuter* aWindow,
                                                nsISupports *aContext,
                                                uint32_t *aControllerId);
 
   nsresult        SetContextOnControllerById(nsIControllers* aControllers,
                                             nsISupports* aContext,
                                             uint32_t aID);
 
   nsresult        PrepareForEditing(nsPIDOMWindowOuter* aWindow);
--- a/editor/composer/nsIEditingSession.idl
+++ b/editor/composer/nsIEditingSession.idl
@@ -1,21 +1,21 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "domstubs.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIEditor;
 
 %{ C++
-class mozIDOMWindowProxy;
+class nsPIDOMWindowOuter;
 namespace mozilla {
 class HTMLEditor;
 } // namespace mozilla
 %}
 
 [scriptable, builtinclass, uuid(24f963d1-e6fc-43ea-a206-99ac5fcc5265)]
 
 interface nsIEditingSession : nsISupports
@@ -42,80 +42,80 @@ interface nsIEditingSession : nsISupport
    *  @param aWindow nsIDOMWindow, the window the embedder needs to make editable
    *  @param aEditorType string, "html" "htmlsimple" "text" "textsimple"
    *  @param aMakeWholeDocumentEditable if PR_TRUE make the whole document in
    *                                    aWindow editable, otherwise it's the
    *                                    embedder who should make the document
    *                                    (or part of it) editable.
    *  @param aInteractive if PR_FALSE turn off scripting and plugins
    */
-  void makeWindowEditable(in mozIDOMWindowProxy window,
+  void makeWindowEditable(in WindowProxy window,
                           in string aEditorType,
                           in boolean doAfterUriLoad,
                           in boolean aMakeWholeDocumentEditable,
                           in boolean aInteractive);
 
   /**
    *  Test whether a specific window has had its editable flag set; it may have an editor
    *  now, or will get one after the uri load.
    *
    *  Use this, passing the content root window, to test if we've set up editing
    *  for this content.
    */
-  boolean windowIsEditable(in mozIDOMWindowProxy window);
+  boolean windowIsEditable(in WindowProxy window);
 
   /**
    *  Get the editor for this window. May return null
    */
-	nsIEditor getEditorForWindow(in mozIDOMWindowProxy window);
+	nsIEditor getEditorForWindow(in WindowProxy window);
 
   /**
    *  Setup editor and related support objects
    */
-  void setupEditorOnWindow(in mozIDOMWindowProxy window);
+  void setupEditorOnWindow(in WindowProxy window);
 
   /**
    *   Destroy editor and related support objects
    */
-  void tearDownEditorOnWindow(in mozIDOMWindowProxy window);
+  void tearDownEditorOnWindow(in WindowProxy window);
 
-  void setEditorOnControllers(in mozIDOMWindowProxy aWindow,
+  void setEditorOnControllers(in WindowProxy aWindow,
                               in nsIEditor aEditor);
 
   /**
    * Disable scripts and plugins in aWindow.
    */
-  void disableJSAndPlugins(in mozIDOMWindowProxy aWindow);
+  void disableJSAndPlugins(in WindowProxy aWindow);
 
   /**
    * Restore JS and plugins (enable/disable them) according to the state they
    * were before the last call to disableJSAndPlugins.
    */
-  void restoreJSAndPlugins(in mozIDOMWindowProxy aWindow);
+  void restoreJSAndPlugins(in WindowProxy aWindow);
 
   /**
    * Removes all the editor's controllers/listeners etc and makes the window
    * uneditable.
    */
-  void detachFromWindow(in mozIDOMWindowProxy aWindow);
+  void detachFromWindow(in WindowProxy aWindow);
 
   /**
    * Undos detachFromWindow(), reattaches this editing session/editor
    * to the window.
    */
-  void reattachToWindow(in mozIDOMWindowProxy aWindow);
+  void reattachToWindow(in WindowProxy aWindow);
 
   /**
    * Whether this session has disabled JS and plugins.
    */
   readonly attribute boolean jsAndPluginsDisabled;
 
 %{C++
   /**
    * This method is implemented with nsIDocShell::GetHTMLEditor().  I.e.,
    * This method doesn't depend on nsEditingSession.  Therefore, even if
    * there were some implementation of nsIEditingSession interface, this
    * would be safe to use.
    */
-  mozilla::HTMLEditor* GetHTMLEditorForWindow(mozIDOMWindowProxy* aWindow);
+  mozilla::HTMLEditor* GetHTMLEditorForWindow(nsPIDOMWindowOuter* aWindow);
 %}
 };
 
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -4990,17 +4990,17 @@ HTMLEditor::GetFocusedNode()
   return document.forget();
 }
 
 bool
 HTMLEditor::OurWindowHasFocus()
 {
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   NS_ENSURE_TRUE(fm, false);
-  nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
   fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
   if (!focusedWindow) {
     return false;
   }
   nsCOMPtr<nsIDocument> document = GetDocument();
   if (NS_WARN_IF(!document)) {
     return false;
   }
--- a/editor/nsIEditorUtils.idl
+++ b/editor/nsIEditorUtils.idl
@@ -2,17 +2,17 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "domstubs.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 webidl Blob;
 
 [scriptable, builtinclass, uuid(eb8b8ad9-5d8f-43bd-8ce5-5b943c180d56)]
 interface nsIEditorBlobListener : nsISupports
 {
   void onResult(in ACString aResult);
   void onError(in AString aErrorName);
@@ -23,11 +23,11 @@ interface nsIEditorBlobListener : nsISup
  * done in JavaScript.
  */
 [scriptable, uuid(4bf94928-575e-4bd1-8321-a2c4b3d0119e)]
 interface nsIEditorUtils : nsISupports
 {
   /**
    * Given a blob, returns the data from that blob, asynchronously.
    */
-  void slurpBlob(in Blob aBlob, in mozIDOMWindowProxy aScope,
+  void slurpBlob(in Blob aBlob, in WindowProxy aScope,
                  in nsIEditorBlobListener aListener);
 };
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -2182,17 +2182,17 @@ NS_IMETHODIMP
 nsPermissionManager::TestPermission(nsIURI     *aURI,
                                     const char *aType,
                                     uint32_t   *aPermission)
 {
   return CommonTestPermission(aURI, aType, aPermission, false, true);
 }
 
 NS_IMETHODIMP
-nsPermissionManager::TestPermissionFromWindow(mozIDOMWindow* aWindow,
+nsPermissionManager::TestPermissionFromWindow(nsPIDOMWindowInner* aWindow,
                                               const char* aType,
                                               uint32_t* aPermission)
 {
   NS_ENSURE_ARG(aWindow);
   nsCOMPtr<nsPIDOMWindowInner> window = nsPIDOMWindowInner::From(aWindow);
 
   // Get the document for security check
   nsCOMPtr<nsIDocument> document = window->GetExtantDoc();
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -1016,20 +1016,20 @@ XPCConvert::JSObject2NativeInterface(voi
         // else...
 
         // Deal with slim wrappers here.
         if (GetISupportsFromJSObject(inner ? inner : src, &iface)) {
             if (iface && NS_SUCCEEDED(iface->QueryInterface(*iid, dest))) {
                 return true;
             }
 
-            // If that failed, and iid is for mozIDOMWindowProxy, we actually
+            // If that failed, and iid is for nsPIDOMWindowOuter, we actually
             // want the outer!
-            if (iid->Equals(NS_GET_IID(mozIDOMWindowProxy))) {
-                if (nsCOMPtr<mozIDOMWindow> inner = do_QueryInterface(iface)) {
+            if (iid->Equals(NS_GET_IID(nsPIDOMWindowOuter))) {
+                if (nsCOMPtr<nsPIDOMWindowInner> inner = do_QueryInterface(iface)) {
                     iface = nsPIDOMWindowInner::From(inner)->GetOuterWindow();
                     return NS_SUCCEEDED(iface->QueryInterface(*iid, dest));
                 }
             }
 
             return false;
         }
 
--- a/js/xpconnect/wrappers/AccessCheck.cpp
+++ b/js/xpconnect/wrappers/AccessCheck.cpp
@@ -134,17 +134,17 @@ IsFrameId(JSContext* cx, JSObject* obj, 
         return false;
     }
 
     nsCOMPtr<nsIDOMWindowCollection> col = win->GetFrames();
     if (!col) {
         return false;
     }
 
-    nsCOMPtr<mozIDOMWindowProxy> domwin;
+    nsCOMPtr<nsPIDOMWindowOuter> domwin;
     if (JSID_IS_INT(id)) {
         col->Item(JSID_TO_INT(id), getter_AddRefs(domwin));
     } else if (JSID_IS_STRING(id)) {
         nsAutoJSString idAsString;
         if (!idAsString.init(cx, JSID_TO_STRING(id))) {
             return false;
         }
         col->NamedItem(idAsString, getter_AddRefs(domwin));
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -3226,17 +3226,17 @@ PresShell::GoToAnchor(const nsAString& a
       }
     }
     // Selection is at anchor.
     // Now focus the document itself if focus is on an element within it.
     nsPIDOMWindowOuter *win = mDocument->GetWindow();
 
     nsIFocusManager* fm = nsFocusManager::GetFocusManager();
     if (fm && win) {
-      nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
+      nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
       fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
       if (SameCOMIdentity(win, focusedWindow)) {
         fm->ClearFocus(focusedWindow);
       }
     }
 
     // If the target is an animation element, activate the animation
     if (content->IsNodeOfType(nsINode::eANIMATION)) {
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -3968,17 +3968,17 @@ nsDocumentViewer::Print(nsIPrintSettings
   if (NS_FAILED(rv)) {
     OnDonePrinting();
   }
   return rv;
 }
 
 NS_IMETHODIMP
 nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
-                               mozIDOMWindowProxy* aChildDOMWin,
+                               nsPIDOMWindowOuter* aChildDOMWin,
                                nsIWebProgressListener* aWebProgressListener)
 {
 #if defined(NS_PRINTING) && defined(NS_PRINT_PREVIEW)
   MOZ_ASSERT(IsInitializedForPrintPreview(),
     "For print preview nsIWebBrowserPrint must be from docshell.printPreview!");
 
   NS_ENSURE_ARG_POINTER(aChildDOMWin);
   nsresult rv = NS_OK;
--- a/layout/printing/nsIPrintProgress.idl
+++ b/layout/printing/nsIPrintProgress.idl
@@ -1,25 +1,25 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "nsIWebProgressListener.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIObserver;
 interface nsIPrompt;
 
 [scriptable, uuid(05f4fb88-e568-4d35-b394-ce0aa3eea6fc)]
 interface nsIPrintProgress: nsIWebProgressListener {
 
   /* Open the progress dialog
      you can specify parameters through an xpcom object
   */
-  void openProgressDialog(in mozIDOMWindowProxy parent, 
+  void openProgressDialog(in WindowProxy parent, 
                           in string dialogURL, 
                           in nsISupports parameters, 
                           in nsIObserver openDialogObserver,
                           out boolean notifyOnOpen);
   
   /* Close the progress dialog */
   void closeProgressDialog(in boolean forceClose);
   
--- a/layout/printing/nsPrintJob.cpp
+++ b/layout/printing/nsPrintJob.cpp
@@ -1036,17 +1036,17 @@ nsPrintJob::Print(nsIPrintSettings*     
     mPrtPreview && mPrtPreview->mPrintObject ?
       mPrtPreview->mPrintObject->mDocument : mDocument;
 
   return CommonPrint(false, aPrintSettings, aWebProgressListener, doc);
 }
 
 NS_IMETHODIMP
 nsPrintJob::PrintPreview(nsIPrintSettings* aPrintSettings,
-                         mozIDOMWindowProxy* aChildDOMWin,
+                         nsPIDOMWindowOuter* aChildDOMWin,
                          nsIWebProgressListener* aWebProgressListener)
 {
   // Get the DocShell and see if it is busy
   // (We can't Print Preview this document if it is still busy)
   nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mContainer));
   NS_ENSURE_STATE(docShell);
 
   uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
--- a/layout/printing/nsPrintJob.h
+++ b/layout/printing/nsPrintJob.h
@@ -53,17 +53,17 @@ public:
   NS_DECL_NSIOBSERVER
 
   NS_DECL_NSIWEBPROGRESSLISTENER
 
   // Old nsIWebBrowserPrint methods; not cleaned up yet
   NS_IMETHOD Print(nsIPrintSettings*       aPrintSettings,
                    nsIWebProgressListener* aWebProgressListener);
   NS_IMETHOD PrintPreview(nsIPrintSettings* aPrintSettings,
-                          mozIDOMWindowProxy* aChildDOMWin,
+                          nsPIDOMWindowOuter* aChildDOMWin,
                           nsIWebProgressListener* aWebProgressListener);
   NS_IMETHOD GetIsFramesetDocument(bool *aIsFramesetDocument);
   NS_IMETHOD GetIsIFrameSelected(bool *aIsIFrameSelected);
   NS_IMETHOD GetIsRangeSelection(bool *aIsRangeSelection);
   NS_IMETHOD GetIsFramesetFrameSelected(bool *aIsFramesetFrameSelected);
   NS_IMETHOD GetPrintPreviewNumPages(int32_t *aPrintPreviewNumPages);
   NS_IMETHOD EnumerateDocumentNames(uint32_t* aCount, char16_t*** aResult);
   NS_IMETHOD GetDoingPrint(bool *aDoingPrint);
--- a/layout/tools/layout-debug/src/nsILayoutDebuggingTools.idl
+++ b/layout/tools/layout-debug/src/nsILayoutDebuggingTools.idl
@@ -1,31 +1,31 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 // vim:cindent:tabstop=4:expandtab:shiftwidth=4:
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 
 /**
  * A series of hooks into non-IDL-ized layout code to allow all the
  * layout debugging functions to be used from chrome.
  */
 
 [scriptable, uuid(f336d8d3-9721-4ad3-85d0-a7018c0a3383)]
 interface nsILayoutDebuggingTools : nsISupports
 {
 
     /*
      * Initialize debugger object to act on a docshell.
      */
-    void init(in mozIDOMWindow win);
+    void init(in Window win);
 
     /*
      * Notify the debugger that the docshell has been told to load a new
      * URI.
      */
     void newURILoaded();
 
     /* Toggle various debugging states */
--- a/layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
+++ b/layout/tools/layout-debug/src/nsLayoutDebugCLH.cpp
@@ -60,17 +60,17 @@ nsLayoutDebugCLH::Handle(nsICommandLine*
         scriptableURL->SetData(url);
         argsArray->AppendElement(scriptableURL);
     }
 
     nsCOMPtr<nsIWindowWatcher> wwatch =
         do_GetService(NS_WINDOWWATCHER_CONTRACTID);
     NS_ENSURE_TRUE(wwatch, NS_ERROR_FAILURE);
 
-    nsCOMPtr<mozIDOMWindowProxy> opened;
+    nsCOMPtr<nsPIDOMWindowOuter> opened;
     wwatch->OpenWindow(nullptr, "chrome://layoutdebug/content/",
                        "_blank", "chrome,dialog=no,all", argsArray,
                        getter_AddRefs(opened));
     aCmdLine->SetPreventDefault(true);
     return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
+++ b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
@@ -87,17 +87,17 @@ nsLayoutDebuggingTools::nsLayoutDebuggin
 
 nsLayoutDebuggingTools::~nsLayoutDebuggingTools()
 {
 }
 
 NS_IMPL_ISUPPORTS(nsLayoutDebuggingTools, nsILayoutDebuggingTools)
 
 NS_IMETHODIMP
-nsLayoutDebuggingTools::Init(mozIDOMWindow* aWin)
+nsLayoutDebuggingTools::Init(nsPIDOMWindowInner* aWin)
 {
     if (!Preferences::GetService()) {
         return NS_ERROR_UNEXPECTED;
     }
 
     {
         if (!aWin)
             return NS_ERROR_UNEXPECTED;
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -856,17 +856,17 @@ nsXULPopupManager::ShowTooltipAtScreen(n
 
 static void
 CheckCaretDrawingState()
 {
   // There is 1 caret per document, we need to find the focused
   // document and erase its caret.
   nsIFocusManager* fm = nsFocusManager::GetFocusManager();
   if (fm) {
-    nsCOMPtr<mozIDOMWindowProxy> window;
+    nsCOMPtr<nsPIDOMWindowOuter> window;
     fm->GetFocusedWindow(getter_AddRefs(window));
     if (!window)
       return;
 
     auto* piWindow = nsPIDOMWindowOuter::From(window);
     MOZ_ASSERT(piWindow);
 
     nsCOMPtr<nsIDocument> focusedDoc = piWindow->GetDoc();
@@ -1767,17 +1767,17 @@ nsXULPopupManager::MayShowPopup(nsMenuPo
   // chrome shells can always open popups, but other types of shells can only
   // open popups when they are focused and visible
   if (dsti->ItemType() != nsIDocShellTreeItem::typeChrome) {
     // only allow popups in active windows
     nsIFocusManager* fm = nsFocusManager::GetFocusManager();
     if (!fm || !rootWin)
       return false;
 
-    nsCOMPtr<mozIDOMWindowProxy> activeWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> activeWindow;
     fm->GetActiveWindow(getter_AddRefs(activeWindow));
     if (activeWindow != rootWin)
       return false;
 
     // only allow popups in visible frames
     bool visible;
     baseWin->GetVisibility(&visible);
     if (!visible)
--- a/netwerk/base/mozIThirdPartyUtil.idl
+++ b/netwerk/base/mozIThirdPartyUtil.idl
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIURI;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIChannel;
 
 /**
  * Utility functions for determining whether a given URI, channel, or window
  * hierarchy is third party with respect to a known URI.
  */
 [scriptable, uuid(fd82700e-ffb4-4932-b7d6-08f0b5697dda)]
 interface mozIThirdPartyUtil : nsISupports
@@ -70,17 +70,17 @@ interface mozIThirdPartyUtil : nsISuppor
    *
    * @throws if aWindow is null; the same-type parent of any window in the
    *         hierarchy cannot be determined; or the URI associated with any
    *         window in the hierarchy is null, has a malformed host, or has an
    *         empty host and is not a file:// URI.
    *
    * @see isThirdPartyURI
    */
-  boolean isThirdPartyWindow(in mozIDOMWindowProxy aWindow, [optional] in nsIURI aURI);
+  boolean isThirdPartyWindow(in WindowProxy aWindow, [optional] in nsIURI aURI);
 
   /**
    * isThirdPartyChannel
    *
    * Determine whether the given channel and its content window hierarchy is
    * third party. This is done as follows:
    *
    * 1) If 'aChannel' is an nsIHttpChannel and has the
@@ -142,24 +142,24 @@ interface mozIThirdPartyUtil : nsISuppor
   AUTF8String getBaseDomain(in nsIURI aHostURI);
 
   /**
    * getURIFromWindow
    *
    * Returns the URI associated with the script object principal for the
    * window.
    */
-  nsIURI getURIFromWindow(in mozIDOMWindowProxy aWindow);
+  nsIURI getURIFromWindow(in WindowProxy aWindow);
 
   /**
    * getTopWindowForChannel
    *
    * Returns the top-level window associated with the given channel.
    */
-  mozIDOMWindowProxy getTopWindowForChannel(in nsIChannel aChannel);
+  WindowProxy getTopWindowForChannel(in nsIChannel aChannel);
 };
 
 %{ C++
 /**
  * The mozIThirdPartyUtil implementation is an XPCOM service registered
  * under the ContractID:
  */
 #define THIRDPARTYUTIL_CONTRACTID "@mozilla.org/thirdpartyutil;1"
--- a/netwerk/base/nsChannelClassifier.cpp
+++ b/netwerk/base/nsChannelClassifier.cpp
@@ -500,17 +500,17 @@ nsChannelClassifier::NotifyTrackingProte
       return NS_OK;
     }
 
     nsresult rv;
     nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
         do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCOMPtr<mozIDOMWindowProxy> win;
+    nsCOMPtr<nsPIDOMWindowOuter> win;
     rv = thirdPartyUtil->GetTopWindowForChannel(aChannel, getter_AddRefs(win));
     NS_ENSURE_SUCCESS(rv, rv);
 
     auto* pwin = nsPIDOMWindowOuter::From(win);
     nsCOMPtr<nsIDocShell> docShell = pwin->GetDocShell();
     if (!docShell) {
       return NS_OK;
     }
@@ -824,17 +824,17 @@ nsChannelClassifier::SetBlockedContent(n
   nsresult rv;
   nsCOMPtr<nsIClassifiedChannel> classifiedChannel = do_QueryInterface(channel, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (classifiedChannel) {
     classifiedChannel->SetMatchedInfo(aList, aProvider, aFullHash);
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> win;
+  nsCOMPtr<nsPIDOMWindowOuter> win;
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
     do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, NS_OK);
   rv = thirdPartyUtil->GetTopWindowForChannel(channel, getter_AddRefs(win));
   NS_ENSURE_SUCCESS(rv, NS_OK);
   auto* pwin = nsPIDOMWindowOuter::From(win);
   nsCOMPtr<nsIDocShell> docShell = pwin->GetDocShell();
   if (!docShell) {
--- a/netwerk/base/nsIPermissionManager.idl
+++ b/netwerk/base/nsIPermissionManager.idl
@@ -28,17 +28,17 @@
  *          the entire permission list was cleared. the subject is null.
  */
 
 #include "nsISupports.idl"
 
 interface nsIURI;
 interface nsIObserver;
 interface nsIPrincipal;
-interface mozIDOMWindow;
+webidl Window;
 interface nsIPermission;
 interface nsISimpleEnumerator;
 interface nsIRunnable;
 
 %{ C++
 namespace IPC {
 struct Permission;
 }
@@ -188,17 +188,17 @@ interface nsIPermissionManager : nsISupp
 
   /**
    * Test whether the principal associated with the window's document has the
    * permission to perform a given action.  System principals will always
    * have permissions granted.
    * This function will perform a pref lookup to permissions.default.<type>
    * if the specific permission type is part of the whitelist for that functionality.
    */
-  uint32_t testPermissionFromWindow(in mozIDOMWindow window,
+  uint32_t testPermissionFromWindow(in Window window,
                                     in string type);
 
   /**
    * Test whether a website has permission to perform the given action.
    * This requires an exact hostname match, subdomains are not a match.
    * This function will perform a pref lookup to permissions.default.<type>
    * if the specific permission type is part of the whitelist for that functionality.
    * @param uri     the uri to be tested
--- a/netwerk/base/nsISecureBrowserUI.idl
+++ b/netwerk/base/nsISecureBrowserUI.idl
@@ -1,23 +1,23 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIDocShell;
 
 [scriptable, uuid(718c662a-f810-4a80-a6c9-0b1810ecade2)]
 interface nsISecureBrowserUI : nsISupports
 {
-    void init(in mozIDOMWindowProxy window);
+    void init(in WindowProxy window);
     void setDocShell(in nsIDocShell docShell);
 
     readonly attribute unsigned long state;
 };
 
 %{C++
 #define NS_SECURE_BROWSER_UI_CONTRACTID "@mozilla.org/secure_browser_ui;1"
 %}
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -498,17 +498,17 @@ HttpBaseChannel::SetDocshellUserAgentOve
   // by UserAgentOverrides.jsm if site-specific user agent overrides are set.
   nsresult rv;
   nsCOMPtr<nsILoadContext> loadContext;
   NS_QueryNotificationCallbacks(this, loadContext);
   if (!loadContext) {
     return NS_OK;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   loadContext->GetAssociatedWindow(getter_AddRefs(domWindow));
   if (!domWindow) {
     return NS_OK;
   }
 
   auto* pDomWindow = nsPIDOMWindowOuter::From(domWindow);
   nsIDocShell* docshell = pDomWindow->GetDocShell();
   if (!docshell) {
@@ -1449,17 +1449,17 @@ HttpBaseChannel::SetChannelId(uint64_t a
 }
 
 NS_IMETHODIMP HttpBaseChannel::GetTopLevelContentWindowId(uint64_t *aWindowId)
 {
   if (!mContentWindowId) {
     nsCOMPtr<nsILoadContext> loadContext;
     GetCallback(loadContext);
     if (loadContext) {
-      nsCOMPtr<mozIDOMWindowProxy> topWindow;
+      nsCOMPtr<nsPIDOMWindowOuter> topWindow;
       loadContext->GetTopWindow(getter_AddRefs(topWindow));
       nsCOMPtr<nsIDOMWindowUtils> windowUtils = do_GetInterface(topWindow);
       if (windowUtils) {
         windowUtils->GetCurrentInnerWindowID(&mContentWindowId);
       }
     }
   }
   *aWindowId = mContentWindowId;
@@ -2324,17 +2324,17 @@ HttpBaseChannel::GetTopWindowURI(nsIURI 
   nsCOMPtr<mozIThirdPartyUtil> util;
   // Only compute the top window URI once. In e10s, this must be computed in the
   // child. The parent gets the top window URI through HttpChannelOpenArgs.
   if (!mTopWindowURI) {
     util = do_GetService(THIRDPARTYUTIL_CONTRACTID);
     if (!util) {
       return NS_ERROR_NOT_AVAILABLE;
     }
-    nsCOMPtr<mozIDOMWindowProxy> win;
+    nsCOMPtr<nsPIDOMWindowOuter> win;
     rv = util->GetTopWindowForChannel(this, getter_AddRefs(win));
     if (NS_SUCCEEDED(rv)) {
       rv = util->GetURIFromWindow(win, getter_AddRefs(mTopWindowURI));
 #if DEBUG
       if (mTopWindowURI) {
         nsCString spec;
         if (NS_SUCCEEDED(mTopWindowURI->GetSpec(spec))) {
           LOG(("HttpChannelBase::Setting topwindow URI spec %s [this=%p]\n",
@@ -4319,17 +4319,17 @@ HttpBaseChannel::GetReferringPage()
 nsPIDOMWindowInner*
 HttpBaseChannel::GetInnerDOMWindow()
 {
     nsCOMPtr<nsILoadContext> loadContext;
     NS_QueryNotificationCallbacks(this, loadContext);
     if (!loadContext) {
         return nullptr;
     }
-    nsCOMPtr<mozIDOMWindowProxy> domWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow;
     loadContext->GetAssociatedWindow(getter_AddRefs(domWindow));
     if (!domWindow) {
         return nullptr;
     }
     auto* pDomWindow = nsPIDOMWindowOuter::From(domWindow);
     if (!pDomWindow) {
         return nullptr;
     }
@@ -4431,17 +4431,17 @@ HttpBaseChannel::EnsureTopLevelOuterCont
   }
 
   nsCOMPtr<nsILoadContext> loadContext;
   GetCallback(loadContext);
   if (!loadContext) {
     return;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> topWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> topWindow;
   loadContext->GetTopWindow(getter_AddRefs(topWindow));
   if (!topWindow) {
     return;
   }
 
   mTopLevelOuterContentWindowId =
     nsPIDOMWindowOuter::From(topWindow)->WindowID();
 }
--- a/security/manager/pki/nsNSSDialogHelper.cpp
+++ b/security/manager/pki/nsNSSDialogHelper.cpp
@@ -11,38 +11,38 @@
 #include "nsIDOMWindow.h"
 #include "nsIServiceManager.h"
 #include "nsIWindowWatcher.h"
 
 static const char kOpenDialogParam[] = "centerscreen,chrome,modal,titlebar";
 static const char kOpenWindowParam[] = "centerscreen,chrome,titlebar";
 
 nsresult
-nsNSSDialogHelper::openDialog(mozIDOMWindowProxy* window, const char* url,
+nsNSSDialogHelper::openDialog(nsPIDOMWindowOuter* window, const char* url,
                               nsISupports* params, bool modal)
 {
   nsresult rv;
   nsCOMPtr<nsIWindowWatcher> windowWatcher =
            do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
   if (NS_FAILED(rv)) return rv;
 
-  nsCOMPtr<mozIDOMWindowProxy> parent = window;
+  nsCOMPtr<nsPIDOMWindowOuter> parent = window;
 
   if (!parent) {
     windowWatcher->GetActiveWindow(getter_AddRefs(parent));
   }
 
   // We're loading XUL into this window, and it's happening on behalf of the
   // system, not on behalf of content. Make sure the initial about:blank window
   // gets a system principal, otherwise we'll bork when trying to wrap the
   // nsIKeyGenThread |arguments| property into the unprivileged scoope.
   MOZ_ASSERT(!strncmp("chrome://", url, strlen("chrome://")));
   mozilla::dom::AutoNoJSAPI nojsapi;
 
-  nsCOMPtr<mozIDOMWindowProxy> newWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> newWindow;
   rv = windowWatcher->OpenWindow(parent,
                                  url,
                                  "_blank",
                                  modal
                                  ? kOpenDialogParam
                                  : kOpenWindowParam,
                                  params,
                                  getter_AddRefs(newWindow));
--- a/security/manager/pki/nsNSSDialogHelper.h
+++ b/security/manager/pki/nsNSSDialogHelper.h
@@ -2,17 +2,17 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsNSSDialogHelper_h
 #define nsNSSDialogHelper_h
 
-class mozIDOMWindowProxy;
+class nsPIDOMWindowOuter;
 class nsISupports;
 
 /**
  * Helper class that uses the window watcher service to open a standard dialog,
  * with or without a parent context.
  */
 class nsNSSDialogHelper
 {
@@ -26,13 +26,13 @@ public:
    *        URL to the XUL dialog.
    * @param params
    *        Parameters to pass to the dialog. Same semantics as the
    *        nsIWindowWatcher.openWindow() |aArguments| parameter.
    * @param modal
    *        true if the dialog should be modal, false otherwise.
    * @return The result of opening the dialog.
    */
-  static nsresult openDialog(mozIDOMWindowProxy* window, const char* url,
+  static nsresult openDialog(nsPIDOMWindowOuter* window, const char* url,
                              nsISupports* params, bool modal = true);
 };
 
 #endif // nsNSSDialogHelper_h
--- a/security/manager/pki/nsNSSDialogs.cpp
+++ b/security/manager/pki/nsNSSDialogs.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * Dialog services for PIP.
  */
 
 #include "nsNSSDialogs.h"
 
-#include "mozIDOMWindow.h"
+#include "nsPIDOMWindow.h"
 #include "nsArray.h"
 #include "nsEmbedCID.h"
 #include "nsHashPropertyBag.h"
 #include "nsIDialogParamBlock.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIKeygenThread.h"
 #include "nsIPromptService.h"
@@ -64,17 +64,17 @@ nsNSSDialogs::SetPassword(nsIInterfaceRe
                   /*out*/ bool* canceled)
 {
   // |ctx| is allowed to be null.
   NS_ENSURE_ARG(canceled);
 
   *canceled = false;
 
   // Get the parent window for the dialog
-  nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(ctx);
+  nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(ctx);
 
   nsCOMPtr<nsIDialogParamBlock> block =
            do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID);
   if (!block) return NS_ERROR_FAILURE;
 
   nsresult rv = block->SetString(1, PromiseFlatString(tokenName).get());
   if (NS_FAILED(rv)) return rv;
 
@@ -117,17 +117,17 @@ nsNSSDialogs::ConfirmDownloadCACert(nsII
 
   nsCOMPtr<nsIWritablePropertyBag2> retVals = new nsHashPropertyBag();
   rv = argArray->AppendElement(retVals);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Get the parent window for the dialog
-  nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(ctx);
+  nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(ctx);
   rv = nsNSSDialogHelper::openDialog(parent,
                                      "chrome://pippki/content/downloadcert.xul",
                                      argArray);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   rv = retVals->GetPropertyAsBool(NS_LITERAL_STRING("importConfirmed"),
@@ -270,17 +270,17 @@ NS_IMETHODIMP
 nsNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor* ctx,
                             /*out*/ nsAString& password,
                             /*out*/ bool* confirmedPassword)
 {
   // |ctx| is allowed to be null.
   NS_ENSURE_ARG(confirmedPassword);
 
   // Get the parent window for the dialog
-  nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(ctx);
+  nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(ctx);
   nsCOMPtr<nsIWritablePropertyBag2> retVals = new nsHashPropertyBag();
   nsresult rv =
     nsNSSDialogHelper::openDialog(parent,
                                   "chrome://pippki/content/setp12password.xul",
                                   retVals);
   if (NS_FAILED(rv)) {
     return rv;
   }
@@ -314,17 +314,17 @@ nsNSSDialogs::GetPKCS12FilePassword(nsII
   nsAutoString msg;
   nsresult rv = mPIPStringBundle->GetStringFromName(
     "getPKCS12FilePasswordMessage", msg);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Get the parent window for the dialog
-  nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(ctx);
+  nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(ctx);
   bool ignored = false;
   char16_t* pwTemp = nullptr;
   rv = promptSvc->PromptPassword(parent, nullptr, msg.get(), &pwTemp, nullptr,
                                  &ignored, _retval);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
@@ -338,30 +338,30 @@ nsNSSDialogs::GetPKCS12FilePassword(nsII
 
 NS_IMETHODIMP
 nsNSSDialogs::ViewCert(nsIInterfaceRequestor* ctx, nsIX509Cert* cert)
 {
   // |ctx| is allowed to be null.
   NS_ENSURE_ARG(cert);
 
   // Get the parent window for the dialog
-  nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(ctx);
+  nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(ctx);
   return nsNSSDialogHelper::openDialog(parent,
                                        "chrome://pippki/content/certViewer.xul",
                                        cert,
                                        false /*modal*/);
 }
 
 NS_IMETHODIMP
 nsNSSDialogs::DisplayGeneratingKeypairInfo(nsIInterfaceRequestor *aCtx, nsIKeygenThread *runnable)
 {
   nsresult rv;
 
   // Get the parent window for the dialog
-  nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(aCtx);
+  nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(aCtx);
 
   rv = nsNSSDialogHelper::openDialog(parent,
                                      "chrome://pippki/content/createCertInfo.xul",
                                      runnable);
   return rv;
 }
 
 NS_IMETHODIMP
@@ -415,28 +415,28 @@ nsNSSDialogs::DisplayProtectedAuth(nsIIn
     // We cannot use nsNSSDialogHelper here. We cannot allow close widget
     // in the window because protected authentication is interruptible
     // from user interface and changing nsNSSDialogHelper's static variable
     // would not be thread-safe
 
     nsresult rv = NS_ERROR_FAILURE;
 
     // Get the parent window for the dialog
-    nsCOMPtr<mozIDOMWindowProxy> parent = do_GetInterface(aCtx);
+    nsCOMPtr<nsPIDOMWindowOuter> parent = do_GetInterface(aCtx);
 
     nsCOMPtr<nsIWindowWatcher> windowWatcher =
         do_GetService("@mozilla.org/embedcomp/window-watcher;1", &rv);
     if (NS_FAILED(rv))
         return rv;
 
     if (!parent) {
         windowWatcher->GetActiveWindow(getter_AddRefs(parent));
     }
 
-    nsCOMPtr<mozIDOMWindowProxy> newWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> newWindow;
     rv = windowWatcher->OpenWindow(parent,
         "chrome://pippki/content/protectedAuth.xul",
         "_blank",
         "centerscreen,chrome,modal,titlebar,close=no",
         runnable,
         getter_AddRefs(newWindow));
 
     return rv;
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -88,17 +88,17 @@ nsSecureBrowserUIImpl::nsSecureBrowserUI
 
 NS_IMPL_ISUPPORTS(nsSecureBrowserUIImpl,
                   nsISecureBrowserUI,
                   nsIWebProgressListener,
                   nsISupportsWeakReference,
                   nsISSLStatusProvider)
 
 NS_IMETHODIMP
-nsSecureBrowserUIImpl::Init(mozIDOMWindowProxy* aWindow)
+nsSecureBrowserUIImpl::Init(nsPIDOMWindowOuter* aWindow)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (MOZ_LOG_TEST(gSecureDocLog, LogLevel::Debug)) {
     nsCOMPtr<nsIDOMWindow> window(do_QueryReferent(mWindow));
 
     MOZ_LOG(gSecureDocLog, LogLevel::Debug,
            ("SecureUI:%p: Init: mWindow: %p, aWindow: %p\n", this,
@@ -524,20 +524,20 @@ nsSecureBrowserUIImpl::OnStateChange(nsI
 
     I saw that the web progress we get delivered has a reference to the toplevel DOM window.
 
     I suggest, we look at all incoming requests.
     If a request is NOT for the toplevel DOM window, we will always treat it as a subdocument request,
     regardless of whether the load flags indicate a top level document.
   */
 
-  nsCOMPtr<mozIDOMWindowProxy> windowForProgress;
+  nsCOMPtr<nsPIDOMWindowOuter> windowForProgress;
   aWebProgress->GetDOMWindow(getter_AddRefs(windowForProgress));
 
-  nsCOMPtr<mozIDOMWindowProxy> window(do_QueryReferent(mWindow));
+  nsCOMPtr<nsPIDOMWindowOuter> window(do_QueryReferent(mWindow));
   MOZ_ASSERT(window, "Window has gone away?!");
 
   if (!mIOService) {
     mIOService = do_GetService(NS_IOSERVICE_CONTRACTID);
   }
 
   bool isNoContentResponse = false;
   nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aRequest);
@@ -1057,17 +1057,17 @@ nsSecureBrowserUIImpl::OnLocationChange(
   MOZ_ASSERT(NS_IsMainThread());
   ReentrancyGuard guard(*this);
 
   MOZ_LOG(gSecureDocLog, LogLevel::Debug,
          ("SecureUI:%p: OnLocationChange\n", this));
 
   bool updateIsViewSource = false;
   bool temp_IsViewSource = false;
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
 
   if (aLocation)
   {
     bool vs;
 
     nsresult rv = aLocation->SchemeIs("view-source", &vs);
     NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1096,17 +1096,17 @@ nsSecureBrowserUIImpl::OnLocationChange(
   // The location bar has changed, so we must update the security state.  The
   // only concern with doing this here is that a page may transition from being
   // reported as completely secure to being reported as partially secure
   // (mixed).  This may be confusing for users, and it may bother users who
   // like seeing security dialogs.  However, it seems prudent given that page
   // loading may never end in some edge cases (perhaps by a site with malicious
   // intent).
 
-  nsCOMPtr<mozIDOMWindowProxy> windowForProgress;
+  nsCOMPtr<nsPIDOMWindowOuter> windowForProgress;
   aWebProgress->GetDOMWindow(getter_AddRefs(windowForProgress));
 
   nsCOMPtr<nsISupports> securityInfo(ExtractSecurityInfo(aRequest));
 
   if (windowForProgress.get() == window.get()) {
     // For toplevel channels, update the security state right away.
     mOnLocationChangeSeen = true;
     EvaluateAndUpdateSecurityState(aRequest, securityInfo, true, false);
--- a/toolkit/components/alerts/nsXULAlerts.cpp
+++ b/toolkit/components/alerts/nsXULAlerts.cpp
@@ -36,17 +36,17 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXULAlertObserver)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXULAlertObserver)
 
 NS_IMETHODIMP
 nsXULAlertObserver::Observe(nsISupports* aSubject, const char* aTopic,
                             const char16_t* aData)
 {
   if (!strcmp("alertfinished", aTopic)) {
-    mozIDOMWindowProxy* currentAlert = mXULAlerts->mNamedWindows.GetWeak(mAlertName);
+    nsPIDOMWindowOuter* currentAlert = mXULAlerts->mNamedWindows.GetWeak(mAlertName);
     // The window in mNamedWindows might be a replacement, thus it should only
     // be removed if it is the same window that is associated with this listener.
     if (currentAlert == mAlertWindow) {
       mXULAlerts->mNamedWindows.Remove(mAlertName);
 
       if (mIsPersistent) {
         mXULAlerts->PersistentAlertFinished();
       }
@@ -297,19 +297,19 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAle
   rv = argsArray->AppendElement(scriptableRequireInteraction);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Alerts with the same name should replace the old alert in the same position.
   // Provide the new alert window with a pointer to the replaced window so that
   // it may take the same position.
   nsCOMPtr<nsISupportsInterfacePointer> replacedWindow = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_TRUE(replacedWindow, NS_ERROR_FAILURE);
-  mozIDOMWindowProxy* previousAlert = mNamedWindows.GetWeak(name);
+  nsPIDOMWindowOuter* previousAlert = mNamedWindows.GetWeak(name);
   replacedWindow->SetData(previousAlert);
-  replacedWindow->SetDataIID(&NS_GET_IID(mozIDOMWindowProxy));
+  replacedWindow->SetDataIID(&NS_GET_IID(nsPIDOMWindowOuter));
   rv = argsArray->AppendElement(replacedWindow);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (requireInteraction) {
     mPersistentAlertCount++;
   }
 
   // Add an observer (that wraps aAlertListener) to remove the window from
@@ -337,17 +337,17 @@ nsXULAlerts::ShowAlertWithIconURI(nsIAle
     nsAutoCString iconURL;
     rv = aIconURI->GetSpec(iconURL);
     NS_ENSURE_SUCCESS(rv, rv);
     scriptableIconURL->SetData(iconURL);
   }
   rv = argsArray->AppendElement(scriptableIconURL);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<mozIDOMWindowProxy> newWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> newWindow;
   nsAutoCString features("chrome,dialog=yes,titlebar=no,popup=yes");
   if (inPrivateBrowsing) {
     features.AppendLiteral(",private");
   }
   rv = wwatch->OpenWindow(nullptr, ALERT_CHROME_URL, "_blank", features.get(),
                           argsArray, getter_AddRefs(newWindow));
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -370,15 +370,15 @@ nsXULAlerts::GetManualDoNotDisturb(bool*
   *aRetVal = mDoNotDisturb;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsXULAlerts::CloseAlert(const nsAString& aAlertName,
                         nsIPrincipal* aPrincipal)
 {
-  mozIDOMWindowProxy* alert = mNamedWindows.GetWeak(aAlertName);
+  nsPIDOMWindowOuter* alert = mNamedWindows.GetWeak(aAlertName);
   if (nsCOMPtr<nsPIDOMWindowOuter> domWindow = nsPIDOMWindowOuter::From(alert)) {
     domWindow->DispatchCustomEvent(NS_LITERAL_STRING("XULAlertClose"));
   }
   return NS_OK;
 }
 
--- a/toolkit/components/alerts/nsXULAlerts.h
+++ b/toolkit/components/alerts/nsXULAlerts.h
@@ -6,17 +6,17 @@
 #ifndef nsXULAlerts_h__
 #define nsXULAlerts_h__
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsDataHashtable.h"
 #include "nsHashKeys.h"
 #include "nsInterfaceHashtable.h"
 
-#include "mozIDOMWindow.h"
+#include "nsPIDOMWindow.h"
 #include "nsIObserver.h"
 
 struct PendingAlert
 {
   void Init(nsIAlertNotification* aAlert, nsIObserver* aListener)
   {
     mAlert = aAlert;
     mListener = aListener;
@@ -41,17 +41,17 @@ public:
   }
 
   static already_AddRefed<nsXULAlerts> GetInstance();
 
 protected:
   virtual ~nsXULAlerts() {}
   void PersistentAlertFinished();
 
-  nsInterfaceHashtable<nsStringHashKey, mozIDOMWindowProxy> mNamedWindows;
+  nsInterfaceHashtable<nsStringHashKey, nsPIDOMWindowOuter> mNamedWindows;
   uint32_t mPersistentAlertCount = 0;
   nsTArray<PendingAlert> mPendingPersistentAlerts;
   bool mDoNotDisturb = false;
 };
 
 /**
  * This class wraps observers for alerts and watches
  * for the "alertfinished" event in order to release
@@ -63,22 +63,22 @@ public:
   NS_DECL_NSIOBSERVER
   NS_DECL_CYCLE_COLLECTION_CLASS(nsXULAlertObserver)
 
   nsXULAlertObserver(nsXULAlerts* aXULAlerts, const nsAString& aAlertName,
                      nsIObserver* aObserver, bool aIsPersistent)
     : mXULAlerts(aXULAlerts), mAlertName(aAlertName),
       mObserver(aObserver), mIsPersistent(aIsPersistent) {}
 
-  void SetAlertWindow(mozIDOMWindowProxy* aWindow) { mAlertWindow = aWindow; }
+  void SetAlertWindow(nsPIDOMWindowOuter* aWindow) { mAlertWindow = aWindow; }
 
 protected:
   virtual ~nsXULAlertObserver() {}
 
   RefPtr<nsXULAlerts> mXULAlerts;
   nsString mAlertName;
-  nsCOMPtr<mozIDOMWindowProxy> mAlertWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> mAlertWindow;
   nsCOMPtr<nsIObserver> mObserver;
   bool mIsPersistent;
 };
 
 #endif /* nsXULAlerts_h__ */
 
--- a/toolkit/components/browser/nsIPrintingPromptService.idl
+++ b/toolkit/components/browser/nsIPrintingPromptService.idl
@@ -91,17 +91,17 @@ interface nsIPrintingPromptService : nsI
   /**
    *  Show the Print Dialog 
    *
    *  @param parent - a DOM windows the dialog will be parented to (required)
    *  @param webBrowserPrint - represents the document to be printed (required)
    *  @param printSettings - PrintSettings for print "job" (required)
    *
    */
-  void showPrintDialog(in mozIDOMWindowProxy parent,
+  void showPrintDialog(in WindowProxy parent,
                        in nsIWebBrowserPrint webBrowserPrint,
                        in nsIPrintSettings printSettings);
 
   /**
    *  Shows the print progress dialog
    *
    *  @param parent - a DOM windows the dialog will be parented to
    *  @param webBrowserPrint - represents the document to be printed
@@ -110,32 +110,32 @@ interface nsIPrintingPromptService : nsI
    *  @param isForPrinting - true - for printing, false for print preview
    *  @param webProgressListener - additional listener can be registered for progress notifications
    *  @param printProgressParams - parameter object for passing progress state
    *  @param notifyOnOpen - this indicates that the observer will be notified when the progress
    *                        dialog has been opened. If false is returned it means the observer
    *                        (usually the caller) shouldn't wait
    *                        For Print Preview Progress there is intermediate progress
    */
-  void showProgress(in mozIDOMWindowProxy parent,
+  void showProgress(in WindowProxy parent,
                     in nsIWebBrowserPrint webBrowserPrint,
                     in nsIPrintSettings printSettings,
                     in nsIObserver openDialogObserver,
                     in boolean isForPrinting,
                     out nsIWebProgressListener webProgressListener,
                     out nsIPrintProgressParams printProgressParams,
                     out boolean notifyOnOpen);
 
   /**
    *  Shows the print progress dialog
    *
    *  @param parent - a DOM windows the dialog will be parented to (required)
    *  @param printSettings - PrintSettings for page setup (required)
    */
-  void showPageSetup(in mozIDOMWindowProxy parent,
+  void showPageSetup(in WindowProxy parent,
                      in nsIPrintSettings printSettings);
 
 };
 
 %{C++
 // {260FEDC5-524D-4aa6-9A41-E829F4C78B92}
 #define NS_PRINTINGPROMPTSERVICE_IID \
  {0x260fedc5, 0x524d, 0x4aa6, { 0x9a, 0x41, 0xe8, 0x29, 0xf4, 0xc7, 0x8b, 0x92}}
--- a/toolkit/components/browser/nsIWebBrowser.idl
+++ b/toolkit/components/browser/nsIWebBrowser.idl
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIInterfaceRequestor;
 interface nsIWebBrowserChrome;
 interface nsIURIContentListener;
 interface nsIDOMWindow;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIWeakReference;
 
 %{C++
 namespace mozilla {
 class OriginAttributes;
 }
 %}
 
@@ -135,17 +135,17 @@ interface nsIWebBrowser : nsISupports
     attribute nsIURIContentListener parentURIContentListener;
 
     /**
      * The top-level DOM window. The embedder may walk the entire
      * DOM starting from this value.
      *
      * @see nsIDOMWindow
      */
-    readonly attribute mozIDOMWindowProxy contentDOMWindow;
+    readonly attribute WindowProxy contentDOMWindow;
 
     /**
      * Whether this web browser is active. Active means that it's visible
      * enough that we want to avoid certain optimizations like discarding
      * decoded image data and throttling the refresh driver. In Firefox,
      * this corresponds to the visible tab.
      *
      * Defaults to true. For optimal performance, set it to false when
--- a/toolkit/components/browser/nsIWebBrowserFocus.idl
+++ b/toolkit/components/browser/nsIWebBrowserFocus.idl
@@ -1,15 +1,15 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 webidl Element;
 
 #include "nsISupports.idl"
 
 /**
  * nsIWebBrowserFocus
  * Interface that embedders use for controlling and interacting
@@ -62,16 +62,16 @@ interface nsIWebBrowserFocus : nsISuppor
    * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
    */
   void setFocusAtLastElement();
   
   /**
    * The currently focused nsDOMWindow when the browser is active,
    * or the last focused nsDOMWindow when the browser is inactive.
    */
-  attribute mozIDOMWindowProxy focusedWindow;
+  attribute WindowProxy focusedWindow;
   
   /**
    * The currently focused nsDOMElement when the browser is active,
    * or the last focused nsDOMElement when the browser is inactive.
    */
   attribute Element focusedElement;
 };
--- a/toolkit/components/browser/nsIWebBrowserPrint.idl
+++ b/toolkit/components/browser/nsIWebBrowserPrint.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIPrintSettings;
 interface nsIWebProgressListener;
 
 /**
  * nsIWebBrowserPrint corresponds to the main interface
  * for printing an embedded Gecko web browser window/document
  */
 [scriptable, uuid(c9a934ed-fff1-4971-bfba-6c25ad70e1e6)]
@@ -96,17 +96,17 @@ interface nsIWebBrowserPrint : nsISuppor
    *
    * @param aThePrintSettings - Printer Settings for the print preview, if aThePrintSettings is null
    *                            then the global PS will be used.
    * @param aChildDOMWin - DOM Window to be print previewed.
    * @param aWPListener - is updated during the printpreview
    * @return void
    */
   void printPreview(in nsIPrintSettings aThePrintSettings,
-                    in mozIDOMWindowProxy aChildDOMWin,
+                    in WindowProxy aChildDOMWin,
                     in nsIWebProgressListener aWPListener);
 
   /**
    * Print Preview - Navigates within the window
    *
    * @param aNavType - navigation enum
    * @param aPageNum - page num to navigate to when aNavType = ePrintPreviewGoToPageNum
    * @return void
--- a/toolkit/components/browser/nsWebBrowser.cpp
+++ b/toolkit/components/browser/nsWebBrowser.cpp
@@ -361,17 +361,17 @@ nsWebBrowser::SetParentURIContentListene
 
   if (listener) {
     return listener->SetParentContentListener(aParentContentListener);
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::GetContentDOMWindow(mozIDOMWindowProxy** aResult)
+nsWebBrowser::GetContentDOMWindow(nsPIDOMWindowOuter** aResult)
 {
   if (!mDocShell) {
     return NS_ERROR_UNEXPECTED;
   }
 
   nsCOMPtr<nsPIDOMWindowOuter> retval = mDocShell->GetWindow();
   retval.forget(aResult);
   return *aResult ? NS_OK : NS_ERROR_FAILURE;
@@ -1258,17 +1258,17 @@ nsWebBrowser::Create()
     rv = EnableGlobalHistory(mShouldEnableHistory);
     NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "EnableGlobalHistory() failed");
   }
 
   NS_ENSURE_SUCCESS(mDocShellAsWin->Create(), NS_ERROR_FAILURE);
 
   // Hook into the OnSecurityChange() notification for lock/unlock icon
   // updates
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   rv = GetContentDOMWindow(getter_AddRefs(domWindow));
   if (NS_SUCCEEDED(rv)) {
     // this works because the implementation of nsISecureBrowserUI
     // (nsSecureBrowserUIImpl) gets a docShell from the domWindow,
     // and calls docShell->SetSecurityUI(this);
     nsCOMPtr<nsISecureBrowserUI> securityUI =
       do_CreateInstance(NS_SECURE_BROWSER_UI_CONTRACTID, &rv);
     if (NS_SUCCEEDED(rv)) {
@@ -1778,17 +1778,17 @@ nsWebBrowser::PaintWindow(nsIWidget* aWi
     layerManager->SetRoot(root);
   }
 
   layerManager->EndTransaction(DrawPaintedLayer, &mBackgroundColor);
   return true;
 }
 /*
 NS_IMETHODIMP
-nsWebBrowser::GetPrimaryContentWindow(mozIDOMWindowProxy** aDOMWindow)
+nsWebBrowser::GetPrimaryContentWindow(nsPIDOMWindowOuter** aDOMWindow)
 {
   *aDOMWindow = nullptr;
 
   nsCOMPtr<nsIDocShellTreeItem> item;
   NS_ENSURE_TRUE(mDocShellTreeOwner, NS_ERROR_FAILURE);
   mDocShellTreeOwner->GetPrimaryContentShell(getter_AddRefs(item));
   NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
 
@@ -1838,17 +1838,17 @@ nsWebBrowser::SetFocusAtFirstElement(voi
 
 NS_IMETHODIMP
 nsWebBrowser::SetFocusAtLastElement(void)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::GetFocusedWindow(mozIDOMWindowProxy** aFocusedWindow)
+nsWebBrowser::GetFocusedWindow(nsPIDOMWindowOuter** aFocusedWindow)
 {
   NS_ENSURE_ARG_POINTER(aFocusedWindow);
   *aFocusedWindow = nullptr;
 
   NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsPIDOMWindowOuter> window = mDocShell->GetWindow();
   NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
@@ -1856,17 +1856,17 @@ nsWebBrowser::GetFocusedWindow(mozIDOMWi
   RefPtr<Element> focusedElement;
   nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
   return fm ? fm->GetFocusedElementForWindow(window, true, aFocusedWindow,
                                              getter_AddRefs(focusedElement)) :
               NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowser::SetFocusedWindow(mozIDOMWindowProxy* aFocusedWindow)
+nsWebBrowser::SetFocusedWindow(nsPIDOMWindowOuter* aFocusedWindow)
 {
   nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
   return fm ? fm->SetFocusedWindow(aFocusedWindow) : NS_OK;
 }
 
 NS_IMETHODIMP
 nsWebBrowser::GetFocusedElement(dom::Element** aFocusedElement)
 {
--- a/toolkit/components/extensions/mozIExtensionProcessScript.idl
+++ b/toolkit/components/extensions/mozIExtensionProcessScript.idl
@@ -1,18 +1,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 webidl Document;
 
 [scriptable,uuid(6b09dc51-6caa-4ca7-9d6d-30c87258a630)]
 interface mozIExtensionProcessScript : nsISupports
 {
   void preloadContentScript(in nsISupports contentScript);
 
-  void loadContentScript(in nsISupports contentScript, in mozIDOMWindowProxy window);
+  void loadContentScript(in nsISupports contentScript, in WindowProxy window);
 
   void initExtensionDocument(in nsISupports extension, in Document doc);
 };
--- a/toolkit/components/find/nsIWebBrowserFind.idl
+++ b/toolkit/components/find/nsIWebBrowserFind.idl
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  
 #include "nsISupports.idl"
 
 #include "domstubs.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /* THIS IS A PUBLIC EMBEDDING API */
 
 
 /**
  * nsIWebBrowserFind
  *
  * Searches for text in a web browser.
@@ -107,25 +107,25 @@ interface nsIWebBrowserFindInFrames : ns
 {
     /**
      * currentSearchFrame
      *
      * Frame at which to start the search. Once the search is done, this will
      * be set to be the last frame searched, whether or not a result was found.
      * Has to be equal to or contained within the rootSearchFrame.
      */
-    attribute mozIDOMWindowProxy  currentSearchFrame;
+    attribute WindowProxy  currentSearchFrame;
 
     /**
      * rootSearchFrame
      *
      * Frame within which to confine the search (normally the content area frame).
      * Set this to only search a subtree of the frame hierarchy.
      */
-    attribute mozIDOMWindowProxy  rootSearchFrame;
+    attribute WindowProxy  rootSearchFrame;
         
     /**
      * searchSubframes
      *
      * Whether to recurse down into subframes while searching. Default is true.
      *
      * Setting nsIWebBrowserfind.searchFrames to true sets this to true.
      */
--- a/toolkit/components/find/nsWebBrowserFind.cpp
+++ b/toolkit/components/find/nsWebBrowserFind.cpp
@@ -605,44 +605,44 @@ NS_IMETHODIMP
 nsWebBrowserFind::SetSearchFrames(bool aSearchFrames)
 {
   mSearchSubFrames = aSearchFrames;
   mSearchParentFrames = aSearchFrames;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowserFind::GetCurrentSearchFrame(mozIDOMWindowProxy** aCurrentSearchFrame)
+nsWebBrowserFind::GetCurrentSearchFrame(nsPIDOMWindowOuter** aCurrentSearchFrame)
 {
   NS_ENSURE_ARG_POINTER(aCurrentSearchFrame);
-  nsCOMPtr<mozIDOMWindowProxy> searchFrame = do_QueryReferent(mCurrentSearchFrame);
+  nsCOMPtr<nsPIDOMWindowOuter> searchFrame = do_QueryReferent(mCurrentSearchFrame);
   searchFrame.forget(aCurrentSearchFrame);
   return (*aCurrentSearchFrame) ? NS_OK : NS_ERROR_NOT_INITIALIZED;
 }
 
 NS_IMETHODIMP
-nsWebBrowserFind::SetCurrentSearchFrame(mozIDOMWindowProxy* aCurrentSearchFrame)
+nsWebBrowserFind::SetCurrentSearchFrame(nsPIDOMWindowOuter* aCurrentSearchFrame)
 {
   // is it ever valid to set this to null?
   NS_ENSURE_ARG(aCurrentSearchFrame);
   mCurrentSearchFrame = do_GetWeakReference(aCurrentSearchFrame);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWebBrowserFind::GetRootSearchFrame(mozIDOMWindowProxy** aRootSearchFrame)
+nsWebBrowserFind::GetRootSearchFrame(nsPIDOMWindowOuter** aRootSearchFrame)
 {
   NS_ENSURE_ARG_POINTER(aRootSearchFrame);
-  nsCOMPtr<mozIDOMWindowProxy> searchFrame = do_QueryReferent(mRootSearchFrame);
+  nsCOMPtr<nsPIDOMWindowOuter> searchFrame = do_QueryReferent(mRootSearchFrame);
   searchFrame.forget(aRootSearchFrame);
   return (*aRootSearchFrame) ? NS_OK : NS_ERROR_NOT_INITIALIZED;
 }
 
 NS_IMETHODIMP
-nsWebBrowserFind::SetRootSearchFrame(mozIDOMWindowProxy* aRootSearchFrame)
+nsWebBrowserFind::SetRootSearchFrame(nsPIDOMWindowOuter* aRootSearchFrame)
 {
   // is it ever valid to set this to null?
   NS_ENSURE_ARG(aRootSearchFrame);
   mRootSearchFrame = do_GetWeakReference(aRootSearchFrame);
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/toolkit/components/printingui/ipc/PrintDataUtils.cpp
+++ b/toolkit/components/printingui/ipc/PrintDataUtils.cpp
@@ -92,17 +92,17 @@ NS_IMETHODIMP
 MockWebBrowserPrint::Print(nsIPrintSettings* aThePrintSettings,
                            nsIWebProgressListener* aWPListener)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 MockWebBrowserPrint::PrintPreview(nsIPrintSettings* aThePrintSettings,
-                                  mozIDOMWindowProxy* aChildDOMWin,
+                                  nsPIDOMWindowOuter* aChildDOMWin,
                                   nsIWebProgressListener* aWPListener)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 MockWebBrowserPrint::PrintPreviewNavigate(int16_t aNavType,
                                           int32_t aPageNum)
--- a/toolkit/components/printingui/ipc/nsPrintingProxy.cpp
+++ b/toolkit/components/printingui/ipc/nsPrintingProxy.cpp
@@ -63,17 +63,17 @@ nsPrintingProxy::GetInstance()
 nsresult
 nsPrintingProxy::Init()
 {
   mozilla::Unused << ContentChild::GetSingleton()->SendPPrintingConstructor(this);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsPrintingProxy::ShowPrintDialog(mozIDOMWindowProxy *parent,
+nsPrintingProxy::ShowPrintDialog(nsPIDOMWindowOuter *parent,
                                  nsIWebBrowserPrint *webBrowserPrint,
                                  nsIPrintSettings *printSettings)
 {
   NS_ENSURE_ARG(webBrowserPrint);
   NS_ENSURE_ARG(printSettings);
 
   // If parent is null we are just being called to retrieve the print settings
   // from the printer in the parent for print preview.
@@ -119,17 +119,17 @@ nsPrintingProxy::ShowPrintDialog(mozIDOM
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = printSettingsSvc->DeserializeToPrintSettings(dialog->data(),
                                                     printSettings);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsPrintingProxy::ShowProgress(mozIDOMWindowProxy*      parent,
+nsPrintingProxy::ShowProgress(nsPIDOMWindowOuter*      parent,
                               nsIWebBrowserPrint*      webBrowserPrint,    // ok to be null
                               nsIPrintSettings*        printSettings,      // ok to be null
                               nsIObserver*             openDialogObserver, // ok to be null
                               bool                     isForPrinting,
                               nsIWebProgressListener** webProgressListener,
                               nsIPrintProgressParams** printProgressParams,
                               bool*                  notifyOnOpen)
 {
@@ -176,17 +176,17 @@ nsPrintingProxy::ShowProgress(mozIDOMWin
     NS_ADDREF(*webProgressListener = dialogChild);
   }
   NS_ADDREF(*printProgressParams = dialogChild);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsPrintingProxy::ShowPageSetup(mozIDOMWindowProxy *parent,
+nsPrintingProxy::ShowPageSetup(nsPIDOMWindowOuter *parent,
                                nsIPrintSettings *printSettings)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 nsresult
 nsPrintingProxy::SavePrintSettings(nsIPrintSettings* aPS,
                                    bool aUsePrinterNamePrefix,
--- a/toolkit/components/printingui/nsPrintProgress.cpp
+++ b/toolkit/components/printingui/nsPrintProgress.cpp
@@ -37,17 +37,17 @@ nsPrintProgress::nsPrintProgress(nsIPrin
   m_PrintSetting = aPrintSettings;
 }
 
 nsPrintProgress::~nsPrintProgress()
 {
   (void)ReleaseListeners();
 }
 
-NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(mozIDOMWindowProxy *parent,
+NS_IMETHODIMP nsPrintProgress::OpenProgressDialog(nsPIDOMWindowOuter *parent,
                                                   const char *dialogURL,
                                                   nsISupports *parameters,
                                                   nsIObserver *openDialogObserver,
                                                   bool *notifyOnOpen)
 {
   *notifyOnOpen = true;
   m_observer = openDialogObserver;
   nsresult rv = NS_ERROR_FAILURE;
@@ -81,17 +81,17 @@ NS_IMETHODIMP nsPrintProgress::OpenProgr
     NS_ENSURE_STATE(pParentWindow);
     nsCOMPtr<nsIDocShell> docShell = pParentWindow->GetDocShell();
     NS_ENSURE_STATE(docShell);
 
     nsCOMPtr<nsIDocShellTreeOwner> owner;
     docShell->GetTreeOwner(getter_AddRefs(owner));
 
     nsCOMPtr<nsIXULWindow> ownerXULWindow = do_GetInterface(owner);
-    nsCOMPtr<mozIDOMWindowProxy> ownerWindow = do_GetInterface(ownerXULWindow);
+    nsCOMPtr<nsPIDOMWindowOuter> ownerWindow = do_GetInterface(ownerXULWindow);
     NS_ENSURE_STATE(ownerWindow);
 
     nsCOMPtr<nsPIDOMWindowOuter> piOwnerWindow = nsPIDOMWindowOuter::From(ownerWindow);
 
     // Open the dialog.
     nsCOMPtr<nsPIDOMWindowOuter> newWindow;
 
     rv = piOwnerWindow->OpenDialog(NS_ConvertASCIItoUTF16(dialogURL),
--- a/toolkit/components/printingui/nsPrintingPromptService.cpp
+++ b/toolkit/components/printingui/nsPrintingPromptService.cpp
@@ -64,17 +64,17 @@ nsPrintingPromptService::Init()
   mWatcher = do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv);
   return rv;
 #else
   return NS_OK;
 #endif
 }
 
 NS_IMETHODIMP
-nsPrintingPromptService::ShowPrintDialog(mozIDOMWindowProxy* parent,
+nsPrintingPromptService::ShowPrintDialog(nsPIDOMWindowOuter* parent,
                                          nsIWebBrowserPrint* webBrowserPrint,
                                          nsIPrintSettings* printSettings)
 {
   NS_ENSURE_ARG(webBrowserPrint);
   NS_ENSURE_ARG(printSettings);
 
   nsCOMPtr<nsIPrintDialogService> dlgPrint(
     do_GetService(NS_PRINTDIALOGSERVICE_CONTRACTID));
@@ -82,17 +82,17 @@ nsPrintingPromptService::ShowPrintDialog
     return dlgPrint->Show(
       nsPIDOMWindowOuter::From(parent), printSettings, webBrowserPrint);
 
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsPrintingPromptService::ShowProgress(
-  mozIDOMWindowProxy* parent,
+  nsPIDOMWindowOuter* parent,
   nsIWebBrowserPrint* webBrowserPrint, // ok to be null
   nsIPrintSettings* printSettings,     // ok to be null
   nsIObserver* openDialogObserver,     // ok to be null
   bool isForPrinting,
   nsIWebProgressListener** webProgressListener,
   nsIPrintProgressParams** printProgressParams,
   bool* notifyOnOpen)
 {
@@ -110,17 +110,17 @@ nsPrintingPromptService::ShowProgress(
 
   nsPrintProgress* prtProgress = new nsPrintProgress(printSettings);
   mPrintProgress = prtProgress;
   mWebProgressListener = prtProgress;
 
   nsCOMPtr<nsIPrintProgressParams> prtProgressParams =
     new nsPrintProgressParams();
 
-  nsCOMPtr<mozIDOMWindowProxy> parentWindow = parent;
+  nsCOMPtr<nsPIDOMWindowOuter> parentWindow = parent;
 
   if (mWatcher && !parentWindow) {
     mWatcher->GetActiveWindow(getter_AddRefs(parentWindow));
   }
 
   if (parentWindow) {
     mPrintProgress->OpenProgressDialog(parentWindow,
                                        isForPrinting ? kPrintProgressDialogURL
@@ -135,17 +135,17 @@ nsPrintingPromptService::ShowProgress(
 
   return NS_OK;
 #else
   return NS_ERROR_NOT_IMPLEMENTED;
 #endif
 }
 
 NS_IMETHODIMP
-nsPrintingPromptService::ShowPageSetup(mozIDOMWindowProxy* parent,
+nsPrintingPromptService::ShowPageSetup(nsPIDOMWindowOuter* parent,
                                        nsIPrintSettings* printSettings)
 {
   NS_ENSURE_ARG(printSettings);
 
   nsCOMPtr<nsIPrintDialogService> dlgPrint(
     do_GetService(NS_PRINTDIALOGSERVICE_CONTRACTID));
   if (dlgPrint)
     return dlgPrint->ShowPageSetup(nsPIDOMWindowOuter::From(parent),
--- a/toolkit/components/remote/nsDBusRemoteService.cpp
+++ b/toolkit/components/remote/nsDBusRemoteService.cpp
@@ -26,17 +26,17 @@
 
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
 NS_IMPL_ISUPPORTS(nsDBusRemoteService,
                   nsIRemoteService)
 
 NS_IMETHODIMP
-nsDBusRemoteService::RegisterWindow(mozIDOMWindow* aWindow)
+nsDBusRemoteService::RegisterWindow(nsPIDOMWindowInner* aWindow)
 {
   // We don't listen for property change events on DBus remote
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 const char* introspect_template =
 "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n"
 "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\";>\n"
--- a/toolkit/components/remote/nsGTKRemoteService.cpp
+++ b/toolkit/components/remote/nsGTKRemoteService.cpp
@@ -56,17 +56,17 @@ static nsIWidget* GetMainWidget(nsPIDOMW
   NS_ENSURE_TRUE(baseWindow, nullptr);
 
   nsCOMPtr<nsIWidget> mainWidget;
   baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
   return mainWidget;
 }
 
 NS_IMETHODIMP
-nsGTKRemoteService::RegisterWindow(mozIDOMWindow* aWindow)
+nsGTKRemoteService::RegisterWindow(nsPIDOMWindowInner* aWindow)
 {
   nsIWidget* mainWidget = GetMainWidget(nsPIDOMWindowInner::From(aWindow));
   NS_ENSURE_TRUE(mainWidget, NS_ERROR_FAILURE);
 
   GtkWidget* widget =
     (GtkWidget*) mainWidget->GetNativeData(NS_NATIVE_SHELLWIDGET);
   NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
 
--- a/toolkit/components/remote/nsIRemoteService.idl
+++ b/toolkit/components/remote/nsIRemoteService.idl
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 
 /**
  * Start and stop the remote service (xremote/phremote), and register
  * windows with the service for backwards compatibility with old xremote
  * clients.
  *
  * @status FLUID This interface is not frozen and is not intended for embedders
  *               who want a frozen API. If you are an embedder and need this
@@ -31,15 +31,15 @@ interface nsIRemoteService : nsISupports
    */
   void startup(in string appName, in string profileName);
 
   /**
    * Register a XUL window with the xremote service. The window will be
    * configured to accept incoming remote requests. If this method is called
    * before startup(), the registration will happen once startup() is called.
    */
-  void registerWindow(in mozIDOMWindow aWindow);
+  void registerWindow(in Window aWindow);
 
   /**
    * Stop the remote service from accepting additional requests.
    */
   void shutdown();
 };
--- a/toolkit/components/remote/nsRemoteService.cpp
+++ b/toolkit/components/remote/nsRemoteService.cpp
@@ -56,17 +56,17 @@ nsRemoteService::Startup(const char* aAp
         obs->AddObserver(this, "xpcom-shutdown", false);
         obs->AddObserver(this, "quit-application", false);
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsRemoteService::RegisterWindow(mozIDOMWindow* aWindow)
+nsRemoteService::RegisterWindow(nsPIDOMWindowInner* aWindow)
 {
     // Note: RegisterWindow() is not implemented/needed by DBus service.
     if (mGtkRemoteService) {
         mGtkRemoteService->RegisterWindow(aWindow);
     }
     return NS_OK;
 }
 
--- a/toolkit/components/sessionstore/nsISessionStoreUtils.idl
+++ b/toolkit/components/sessionstore/nsISessionStoreUtils.idl
@@ -1,42 +1,42 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 webidl EventTarget;
 
 /**
  * A callback passed to nsISessionStoreUtils.forEachNonDynamicChildFrame().
  */
 [function, scriptable, uuid(8199ebf7-76c0-43d6-bcbe-913dd3de3ebf)]
 interface nsISessionStoreUtilsFrameCallback : nsISupports
 {
   /**
    * handleFrame() will be called once for each non-dynamic child frame of the
    * given parent |frame|. The second argument is the |index| of the frame in
    * the list of all child frames.
    */
-  void handleFrame(in mozIDOMWindowProxy frame, in unsigned long index);
+  void handleFrame(in WindowProxy frame, in unsigned long index);
 };
 
 /**
  * SessionStore utility functions implemented in C++ for performance reasons.
  */
 [scriptable, uuid(2be448ef-c783-45de-a0df-442bccbb4532)]
 interface nsISessionStoreUtils : nsISupports
 {
   /**
    * Calls the given |callback| once for each non-dynamic child frame of the
    * given |window|.
    */
-  void forEachNonDynamicChildFrame(in mozIDOMWindowProxy window,
+  void forEachNonDynamicChildFrame(in WindowProxy window,
                                    in nsISessionStoreUtilsFrameCallback callback);
 
   /**
    * Takes the given listener, wraps it in a filter that filters out events from
    * dynamic docShells, and adds that filter as a listener for the given event
    * type on the given event target.  The listener that was added is returned
    * (as nsISupports) so that it can later be removed via
    * removeDynamicFrameFilteredListener.
--- a/toolkit/components/sessionstore/nsSessionStoreUtils.cpp
+++ b/toolkit/components/sessionstore/nsSessionStoreUtils.cpp
@@ -72,17 +72,17 @@ NS_INTERFACE_MAP_END
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DynamicFrameEventFilter)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DynamicFrameEventFilter)
 
 } // anonymous namespace
 
 NS_IMPL_ISUPPORTS(nsSessionStoreUtils, nsISessionStoreUtils)
 
 NS_IMETHODIMP
-nsSessionStoreUtils::ForEachNonDynamicChildFrame(mozIDOMWindowProxy* aWindow,
+nsSessionStoreUtils::ForEachNonDynamicChildFrame(nsPIDOMWindowOuter* aWindow,
                                                  nsISessionStoreUtilsFrameCallback* aCallback)
 {
   NS_ENSURE_TRUE(aWindow, NS_ERROR_INVALID_ARG);
 
   nsCOMPtr<nsPIDOMWindowOuter> outer = nsPIDOMWindowOuter::From(aWindow);
   NS_ENSURE_TRUE(outer, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsIDocShell> docShell = outer->GetDocShell();
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -632,17 +632,17 @@ nsAppStartup::SetScreenId(uint32_t aScre
 
   return appShell->SetScreenId(aScreenId);
 }
 
 NS_IMETHODIMP
 nsAppStartup::CreateChromeWindow2(nsIWebBrowserChrome *aParent,
                                   uint32_t aChromeFlags,
                                   nsITabParent *aOpeningTab,
-                                  mozIDOMWindowProxy* aOpener,
+                                  nsPIDOMWindowOuter* aOpener,
                                   uint64_t aNextTabParentId,
                                   bool *aCancel,
                                   nsIWebBrowserChrome **_retval)
 {
   NS_ENSURE_ARG_POINTER(aCancel);
   NS_ENSURE_ARG_POINTER(_retval);
   *aCancel = false;
   *_retval = 0;
--- a/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
+++ b/toolkit/components/statusfilter/nsBrowserStatusFilter.cpp
@@ -71,17 +71,17 @@ NS_IMETHODIMP
 nsBrowserStatusFilter::RemoveProgressListener(nsIWebProgressListener *aListener)
 {
     if (aListener == mListener)
         mListener = nullptr;
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBrowserStatusFilter::GetDOMWindow(mozIDOMWindowProxy **aResult)
+nsBrowserStatusFilter::GetDOMWindow(nsPIDOMWindowOuter **aResult)
 {
     NS_NOTREACHED("nsBrowserStatusFilter::GetDOMWindow");
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsBrowserStatusFilter::GetDOMWindowID(uint64_t *aResult)
 {
--- a/toolkit/components/typeaheadfind/nsITypeAheadFind.idl
+++ b/toolkit/components/typeaheadfind/nsITypeAheadFind.idl
@@ -6,17 +6,17 @@
 
 /********************************* #includes *********************************/
 
 #include "nsISupports.idl"              // nsISupports
 
 
 /******************************** Declarations *******************************/
 
-interface mozIDOMWindow;
+webidl Window;
 interface nsIDocShell;
 
 webidl Element;
 webidl Range;
 
 
 /****************************** nsTypeAheadFind ******************************/
 
@@ -70,17 +70,17 @@ interface nsITypeAheadFind : nsISupports
   readonly attribute AString searchString;
                                         // Most recent search string
   attribute boolean caseSensitive;      // Searches are case sensitive
   attribute boolean entireWord;         // Search for whole words only
   readonly attribute Element foundLink;
                                         // Most recent elem found, if a link
   readonly attribute Element foundEditable;
                                         // Most recent elem found, if editable
-  readonly attribute mozIDOMWindow currentWindow;
+  readonly attribute Window currentWindow;
                                         // Window of most recent match
 
 
   /******************************* Constants *******************************/
 
   /* Find return codes */
   const unsigned short FIND_FOUND    = 0;
                                         // Successful find
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -552,17 +552,17 @@ nsTypeAheadFind::FindItNow(nsIPresShell 
 
       nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
       if (usesIndependentSelection) {
         /* If a search result is found inside an editable element, we'll focus
          * the element only if focus is in our content window, i.e.
          * |if (focusedWindow.top == ourWindow.top)| */
         bool shouldFocusEditableElement = false;
         if (fm) {
-          nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
+          nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
           nsresult rv = fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
           if (NS_SUCCEEDED(rv) && focusedWindow) {
             auto* fwPI = nsPIDOMWindowOuter::From(focusedWindow);
             nsCOMPtr<nsIDocShellTreeItem> fwTreeItem
               (do_QueryInterface(fwPI->GetDocShell(), &rv));
             if (NS_SUCCEEDED(rv)) {
               nsCOMPtr<nsIDocShellTreeItem> fwRootTreeItem;
               rv = fwTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(fwRootTreeItem));
@@ -746,17 +746,17 @@ nsTypeAheadFind::GetFoundEditable(Elemen
 {
   NS_ENSURE_ARG_POINTER(aFoundEditable);
   *aFoundEditable = mFoundEditable;
   NS_IF_ADDREF(*aFoundEditable);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsTypeAheadFind::GetCurrentWindow(mozIDOMWindow** aCurrentWindow)
+nsTypeAheadFind::GetCurrentWindow(nsPIDOMWindowInner** aCurrentWindow)
 {
   NS_ENSURE_ARG_POINTER(aCurrentWindow);
   *aCurrentWindow = mCurrentWindow;
   NS_IF_ADDREF(*aCurrentWindow);
   return NS_OK;
 }
 
 nsresult
@@ -1083,17 +1083,17 @@ nsTypeAheadFind::Find(const nsAString& a
         do_QueryInterface(presShell->GetDocument());
       if (!document)
         return NS_ERROR_UNEXPECTED;
 
       nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
       if (fm) {
         nsPIDOMWindowOuter* window = document->GetWindow();
         RefPtr<Element> focusedElement;
-        nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
+        nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
         fm->GetFocusedElementForWindow(window, false,
                                        getter_AddRefs(focusedWindow),
                                        getter_AddRefs(focusedElement));
         // If the root element is focused, then it's actually the document
         // that has the focus, so ignore this.
         if (focusedElement && focusedElement != document->GetRootElement()) {
           fm->MoveCaretToFocus(window);
           isFirstVisiblePreferred = false;
--- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
@@ -589,17 +589,17 @@ AddThreatSourceFromRedirectEntry(ThreatH
 static nsresult
 AddTabThreatSources(ThreatHit& aHit, nsIChannel *aChannel)
 {
   if (NS_WARN_IF(!aChannel)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsresult rv;
-  nsCOMPtr<mozIDOMWindowProxy> win;
+  nsCOMPtr<nsPIDOMWindowOuter> win;
   nsCOMPtr<mozIThirdPartyUtil> thirdPartyUtil =
     do_GetService(THIRDPARTYUTIL_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = thirdPartyUtil->GetTopWindowForChannel(aChannel, getter_AddRefs(win));
   NS_ENSURE_SUCCESS(rv, rv);
 
   auto* pwin = nsPIDOMWindowOuter::From(win);
--- a/toolkit/components/windowcreator/nsIWindowCreator2.idl
+++ b/toolkit/components/windowcreator/nsIWindowCreator2.idl
@@ -15,17 +15,17 @@
  * @status
  */
 
 #include "nsIWindowCreator.idl"
 
 interface nsITabParent;
 interface nsIURI;
 interface nsIWebBrowserChrome;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 [scriptable, uuid(b6c44689-f97e-4f32-a723-29eeddfbdc53)]
 
 interface nsIWindowCreator2 : nsIWindowCreator {
 
   /** Create a new window. Gecko will/may call this method, if made
       available to it, to create new windows.
       @param parent Parent window, if any. Null if not. The newly created
@@ -43,17 +43,17 @@ interface nsIWindowCreator2 : nsIWindowC
                     implementation has determined the window should not
                     be created at all. The caller should not default
                     to any possible backup scheme for creating the window.
       @return the new window. Will be null if canceled or an error occurred.
   */
   nsIWebBrowserChrome createChromeWindow2(in nsIWebBrowserChrome parent,
                                           in uint32_t chromeFlags,
                                           in nsITabParent aOpeningTab,
-                                          in mozIDOMWindowProxy aOpener,
+                                          in WindowProxy aOpener,
                                           in unsigned long long aNextTabParentId,
                                           out boolean cancel);
 
   /**
    * B2G multi-screen support. When open another top-level window on b2g,
    * a screen ID is needed for identifying which screen this window is
    * opened to.
    * @param aScreenId Differentiate screens of windows. It is platform-
--- a/toolkit/components/windowcreator/nsIWindowProvider.idl
+++ b/toolkit/components/windowcreator/nsIWindowProvider.idl
@@ -8,17 +8,17 @@
  * open a new window.  This interface can be implemented by Gecko consumers who
  * wish to provide a custom "new window" of their own (for example by returning
  * a new tab, an existing window, etc) instead of just having a real new
  * toplevel window open.
  */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIURI;
 interface nsIDocShellLoadInfo;
 
 /**
  * The nsIWindowProvider interface exists so that the window watcher's default
  * behavior of opening a new window can be easly modified.  When the window
  * watcher needs to open a new window, it will first check with the
  * nsIWindowProvider it gets from the parent window.  If there is no provider
@@ -88,17 +88,17 @@ interface nsIWindowProvider : nsISupport
    *         already existed.
    *
    * @throw NS_ERROR_ABORT if the caller should cease its attempt to open a new
    *                       window.
    *
    * @see nsIWindowWatcher for more information on aFeatures.
    * @see nsIWebBrowserChrome for more information on aChromeFlags.
    */
-  mozIDOMWindowProxy provideWindow(in mozIDOMWindowProxy aParent,
+  WindowProxy provideWindow(in WindowProxy aParent,
                                    in unsigned long aChromeFlags,
                                    in boolean aCalledFromJS,
                                    in boolean aPositionSpecified,
                                    in boolean aSizeSpecified,
                                    in nsIURI aURI,
                                    in AString aName,
                                    in AUTF8String aFeatures,
                                    in boolean aForceNoOpener,
--- a/toolkit/components/windowwatcher/nsIPromptFactory.idl
+++ b/toolkit/components/windowwatcher/nsIPromptFactory.idl
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /**
  * This interface allows creating various prompts that have a specific parent.
  */
 [scriptable, uuid(2803541c-c96a-4ff1-bd7c-9cb566d46aeb)]
 interface nsIPromptFactory : nsISupports
 {
   /**
    * Returns an object implementing the specified interface that creates
    * prompts parented to aParent.
    */
-  void getPrompt(in mozIDOMWindowProxy aParent, in nsIIDRef iid,
+  void getPrompt(in WindowProxy aParent, in nsIIDRef iid,
                  [iid_is(iid),retval] out nsQIResult result);
 };
 
--- a/toolkit/components/windowwatcher/nsIPromptService.idl
+++ b/toolkit/components/windowwatcher/nsIPromptService.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIAuthPromptCallback;
 interface nsIAuthInformation;
 interface nsICancelable;
 interface nsIChannel;
 
 /**
  * This is the interface to the embeddable prompt service; the service that
  * implements nsIPrompt.  Its interface is designed to be just nsIPrompt, each
@@ -49,17 +49,17 @@ interface nsIPromptService : nsISupports
    *
    * @param aParent
    *        The parent window or null.
    * @param aDialogTitle
    *        Text to appear in the title of the dialog.
    * @param aText
    *        Text to appear in the body of the dialog.
    */
-  void alert(in mozIDOMWindowProxy aParent,
+  void alert(in WindowProxy aParent,
              in wstring aDialogTitle,
              in wstring aText);
 
   /**
    * Puts up an alert dialog with an OK button and a labeled checkbox.
    *
    * @param aParent
    *        The parent window or null.
@@ -68,17 +68,17 @@ interface nsIPromptService : nsISupports
    * @param aText
    *        Text to appear in the body of the dialog.
    * @param aCheckMsg
    *        Text to appear with the checkbox.
    * @param aCheckState
    *        Contains the initial checked state of the checkbox when this method
    *        is called and the final checked state after this method returns.
    */
-  void alertCheck(in mozIDOMWindowProxy aParent,
+  void alertCheck(in WindowProxy aParent,
                   in wstring aDialogTitle,
                   in wstring aText,
                   in wstring aCheckMsg,
                   inout boolean aCheckState);
 
   /**
    * Puts up a dialog with OK and Cancel buttons.
    *
@@ -86,17 +86,17 @@ interface nsIPromptService : nsISupports
    *        The parent window or null.
    * @param aDialogTitle
    *        Text to appear in the title of the dialog.
    * @param aText
    *        Text to appear in the body of the dialog.
    *
    * @return true for OK, false for Cancel
    */
-  boolean confirm(in mozIDOMWindowProxy aParent,
+  boolean confirm(in WindowProxy aParent,
                   in wstring aDialogTitle,
                   in wstring aText);
 
   /**
    * Puts up a dialog with OK and Cancel buttons and a labeled checkbox.
    *
    * @param aParent
    *        The parent window or null.
@@ -107,17 +107,17 @@ interface nsIPromptService : nsISupports
    * @param aCheckMsg
    *        Text to appear with the checkbox.
    * @param aCheckState
    *        Contains the initial checked state of the checkbox when this method
    *        is called and the final checked state after this method returns.
    *
    * @return true for OK, false for Cancel
    */
-  boolean confirmCheck(in mozIDOMWindowProxy aParent,
+  boolean confirmCheck(in WindowProxy aParent,
                        in wstring aDialogTitle,
                        in wstring aText,
                        in wstring aCheckMsg,
                        inout boolean aCheckState);
 
   /**
    * Button Flags
    *
@@ -212,17 +212,17 @@ interface nsIPromptService : nsISupports
    * In general, aButtonFlags is constructed per the following example:
    *
    *   aButtonFlags = (BUTTON_POS_0) * (BUTTON_TITLE_AAA) +
    *                  (BUTTON_POS_1) * (BUTTON_TITLE_BBB) +
    *                   BUTTON_POS_1_DEFAULT;
    *
    * where "AAA" and "BBB" correspond to one of the button titles.
    */
-  int32_t confirmEx(in mozIDOMWindowProxy aParent,
+  int32_t confirmEx(in WindowProxy aParent,
                     in wstring aDialogTitle,
                     in wstring aText,
                     in unsigned long aButtonFlags,
                     in wstring aButton0Title,
                     in wstring aButton1Title,
                     in wstring aButton2Title,
                     in wstring aCheckMsg,
                     inout boolean aCheckState);
@@ -244,17 +244,17 @@ interface nsIPromptService : nsISupports
    * @param aCheckMsg
    *        Text to appear with the checkbox.  If null, check box will not be shown.
    * @param aCheckState
    *        Contains the initial checked state of the checkbox when this method
    *        is called and the final checked state after this method returns.
    *
    * @return true for OK, false for Cancel.
    */
-  boolean prompt(in mozIDOMWindowProxy aParent,
+  boolean prompt(in WindowProxy aParent,
                  in wstring aDialogTitle,
                  in wstring aText,
                  inout wstring aValue,
                  in wstring aCheckMsg,
                  inout boolean aCheckState);
 
   /**
    * Puts up a dialog with an edit field, a password field, and an optional,
@@ -279,17 +279,17 @@ interface nsIPromptService : nsISupports
    * @param aCheckMsg
    *        Text to appear with the checkbox.  If null, check box will not be shown.
    * @param aCheckState
    *        Contains the initial checked state of the checkbox when this method
    *        is called and the final checked state after this method returns.
    *
    * @return true for OK, false for Cancel.
    */
-  boolean promptUsernameAndPassword(in mozIDOMWindowProxy aParent,
+  boolean promptUsernameAndPassword(in WindowProxy aParent,
                                     in wstring aDialogTitle,
                                     in wstring aText,
                                     inout wstring aUsername,
                                     inout wstring aPassword,
                                     in wstring aCheckMsg,
                                     inout boolean aCheckState);
 
   /**
@@ -309,17 +309,17 @@ interface nsIPromptService : nsISupports
    * @param aCheckMsg
    *        Text to appear with the checkbox.  If null, check box will not be shown.
    * @param aCheckState
    *        Contains the initial checked state of the checkbox when this method
    *        is called and the final checked state after this method returns.
    *
    * @return true for OK, false for Cancel.
    */
-  boolean promptPassword(in mozIDOMWindowProxy aParent,
+  boolean promptPassword(in WindowProxy aParent,
                          in wstring aDialogTitle,
                          in wstring aText,
                          inout wstring aPassword,
                          in wstring aCheckMsg,
                          inout boolean aCheckState);
 
   /**
    * Puts up a dialog box which has a list box of strings from which the user
@@ -336,39 +336,39 @@ interface nsIPromptService : nsISupports
    * @param aSelectList
    *        The list of strings to display.
    * @param aOutSelection
    *        Contains the index of the selected item in the list when this
    *        method returns true.
    *
    * @return true for OK, false for Cancel.
    */
-  boolean select(in mozIDOMWindowProxy aParent,
+  boolean select(in WindowProxy aParent,
                  in wstring aDialogTitle,
                  in wstring aText,
                  in  uint32_t aCount,
                  [array, size_is(aCount)] in wstring aSelectList,
                  out long aOutSelection);
 
   // NOTE: These functions differ from their nsIAuthPrompt counterparts by
   // having additional checkbox parameters
   // checkValue can be null meaning to show no checkbox
   // checkboxLabel is a wstring so that it can be null from both JS and C++ in
   // a convenient way
   //
   // See nsIAuthPrompt2 for documentation on the semantics of the other
   // parameters.
-  boolean promptAuth(in mozIDOMWindowProxy aParent,
+  boolean promptAuth(in WindowProxy aParent,
                      in nsIChannel aChannel,
                      in uint32_t level,
                      in nsIAuthInformation authInfo,
                      in wstring checkboxLabel,
                      inout boolean checkValue);
 
-  nsICancelable asyncPromptAuth(in mozIDOMWindowProxy aParent,
+  nsICancelable asyncPromptAuth(in WindowProxy aParent,
                                 in nsIChannel aChannel,
                                 in nsIAuthPromptCallback aCallback,
                                 in nsISupports aContext,
                                 in uint32_t level,
                                 in nsIAuthInformation authInfo,
                                 in wstring checkboxLabel,
                                 inout boolean checkValue);
 };
--- a/toolkit/components/windowwatcher/nsIWindowWatcher.idl
+++ b/toolkit/components/windowwatcher/nsIWindowWatcher.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIObserver;
 interface nsIPrompt;
 interface nsIAuthPrompt;
 interface nsISimpleEnumerator;
 interface nsIWebBrowserChrome;
 interface nsIWindowCreator;
 
 
@@ -60,17 +60,17 @@ interface nsIWindowWatcher : nsISupports
             determining the security context to use for the search for a given
             window named aName.
       @note This method should try to set the default charset for the new
             window to the default charset of aParent.  This is not guaranteed,
             however.
       @note This method may dispatch a "toplevel-window-ready" notification
             via nsIObserverService if the window did not already exist.
   */
-  mozIDOMWindowProxy openWindow(in mozIDOMWindowProxy aParent, in string aUrl,
+  WindowProxy openWindow(in WindowProxy aParent, in string aUrl,
                                 in string aName, in string aFeatures,
                                 in nsISupports aArguments);
 
   /** Clients of this service can register themselves to be notified
       when a window is opened or closed (added to or removed from this
       service). This method adds an aObserver to the list of objects
       to be notified.
       @param aObserver the object to be notified when windows are
@@ -101,24 +101,24 @@ interface nsIWindowWatcher : nsISupports
 
   nsISimpleEnumerator getWindowEnumerator();
 
   /** Return a newly created nsIPrompt implementation.
       @param aParent the parent window used for posing alerts. can be null.
       @return a new nsIPrompt object
   */
 
-  nsIPrompt getNewPrompter(in mozIDOMWindowProxy aParent);
+  nsIPrompt getNewPrompter(in WindowProxy aParent);
 
   /** Return a newly created nsIAuthPrompt implementation.
       @param aParent the parent window used for posing alerts. can be null.
       @return a new nsIAuthPrompt object
   */
 
-  nsIAuthPrompt getNewAuthPrompter(in mozIDOMWindowProxy aParent);
+  nsIAuthPrompt getNewAuthPrompter(in WindowProxy aParent);
 
   /** Set the window creator callback. It must be filled in by the app.
       openWindow will use it to create new windows.
       @param creator the callback. if null, the callback will be cleared
                      and window creation capabilities lost.
   */
   void setWindowCreator(in nsIWindowCreator creator);
 
@@ -130,38 +130,38 @@ interface nsIWindowWatcher : nsISupports
   /** Retrieve the chrome window mapped to the given DOM window. Window
       Watcher keeps a list of all top-level DOM windows currently open,
       along with their corresponding chrome interfaces. Since DOM Windows
       lack a (public) means of retrieving their corresponding chrome,
       this method will do that.
       @param aWindow the DOM window whose chrome window the caller needs
       @return the corresponding chrome window
   */
-  nsIWebBrowserChrome getChromeForWindow(in mozIDOMWindowProxy aWindow);
+  nsIWebBrowserChrome getChromeForWindow(in WindowProxy aWindow);
 
   /**
       Retrieve an existing window (or frame).
       @param aTargetName the window name
       @param aCurrentWindow a starting point in the window hierarchy to
                             begin the search.  If null, each toplevel window
                             will be searched.
 
       Note: This method will search all open windows for any window or
       frame with the given window name. Make sure you understand the
       security implications of this before using this method!
   */
-  mozIDOMWindowProxy getWindowByName(in AString aTargetName,
-                                     in mozIDOMWindowProxy aCurrentWindow);
+  WindowProxy getWindowByName(in AString aTargetName,
+                                     in WindowProxy aCurrentWindow);
 
   /** The Watcher serves as a global storage facility for the current active
       (frontmost non-floating-palette-type) window, storing and returning
       it on demand. Users must keep this attribute current, including after
       the topmost window is closed. This attribute obviously can return null
       if no windows are open, but should otherwise always return a valid
       window.
   */
-  attribute mozIDOMWindowProxy activeWindow;
+  attribute WindowProxy activeWindow;
 
 };
 
 %{C++
 #define NS_WINDOWWATCHER_CONTRACTID "@mozilla.org/embedcomp/window-watcher;1"
 %}
--- a/toolkit/components/windowwatcher/nsPIWindowWatcher.idl
+++ b/toolkit/components/windowwatcher/nsPIWindowWatcher.idl
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Private "control" methods on the Window Watcher. These are annoying
    bookkeeping methods, not part of the public (embedding) interface.
 */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIDOMWindow;
 interface nsISimpleEnumerator;
 interface nsIWebBrowserChrome;
 interface nsIDocShellTreeItem;
 interface nsIArray;
 interface nsITabParent;
 interface nsIDocShellLoadInfo;
 
@@ -26,23 +26,23 @@ interface nsPIWindowWatcher : nsISupport
   /** A window has been created. Add it to our list.
       @param aWindow the window to add
       @param aChrome the corresponding chrome window. The DOM window
                      and chrome will be mapped together, and the corresponding
                      chrome can be retrieved using the (not private)
                      method getChromeForWindow. If null, any extant mapping
                      will be cleared.
   */
-  void addWindow(in mozIDOMWindowProxy aWindow,
+  void addWindow(in WindowProxy aWindow,
                  in nsIWebBrowserChrome aChrome);
 
   /** A window has been closed. Remove it from our list.
       @param aWindow the window to remove
   */
-  void removeWindow(in mozIDOMWindowProxy aWindow);
+  void removeWindow(in WindowProxy aWindow);
 
   /** Like the public interface's open(), but can handle openDialog-style
       arguments and calls which shouldn't result in us navigating the window.
 
       @param aParent parent window, if any. Null if no parent.  If it is
              impossible to get to an nsIWebBrowserChrome from aParent, this
              method will effectively act as if aParent were null.
       @param aURL url to which to open the new window. Must already be
@@ -73,17 +73,17 @@ interface nsPIWindowWatcher : nsISupport
       @note This method may examine the JS context stack for purposes of
             determining the security context to use for the search for a given
             window named aName.
       @note This method should try to set the default charset for the new
             window to the default charset of the document in the calling window
             (which is determined based on the JS stack and the value of
             aParent).  This is not guaranteed, however.
   */
-  mozIDOMWindowProxy openWindow2(in mozIDOMWindowProxy aParent, in string aUrl,
+  WindowProxy openWindow2(in WindowProxy aParent, in string aUrl,
                                  in string aName, in string aFeatures,
                                  in boolean aCalledFromScript,
                                  in boolean aDialog,
                                  in boolean aNavigate,
                                  in nsISupports aArgs,
                                  in boolean aIsPopupSpam,
                                  in boolean aForceNoOpener,
                                  in nsIDocShellLoadInfo aLoadInfo);
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -77,17 +77,17 @@ using namespace mozilla::dom;
  ******************** nsWatcherWindowEntry **********************
  ****************************************************************/
 
 class nsWindowWatcher;
 
 struct nsWatcherWindowEntry
 {
 
-  nsWatcherWindowEntry(mozIDOMWindowProxy* aWindow, nsIWebBrowserChrome* aChrome)
+  nsWatcherWindowEntry(nsPIDOMWindowOuter* aWindow, nsIWebBrowserChrome* aChrome)
     : mChrome(nullptr)
   {
     mWindow = aWindow;
     nsCOMPtr<nsISupportsWeakReference> supportsweak(do_QueryInterface(aChrome));
     if (supportsweak) {
       supportsweak->GetWeakReference(getter_AddRefs(mChromeWeak));
     } else {
       mChrome = aChrome;
@@ -96,17 +96,17 @@ struct nsWatcherWindowEntry
     ReferenceSelf();
   }
   ~nsWatcherWindowEntry() {}
 
   void InsertAfter(nsWatcherWindowEntry* aOlder);
   void Unlink();
   void ReferenceSelf();
 
-  mozIDOMWindowProxy* mWindow;
+  nsPIDOMWindowOuter* mWindow;
   nsIWebBrowserChrome* mChrome;
   nsWeakPtr mChromeWeak;
   // each struct is in a circular, doubly-linked list
   nsWatcherWindowEntry* mYounger; // next younger in sequence
   nsWatcherWindowEntry* mOlder;
 };
 
 void
@@ -304,22 +304,22 @@ ConvertArgsToArray(nsISupports* aArgumen
 
   nsresult rv = singletonArray->AppendElement(aArguments);
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   return singletonArray.forget();
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::OpenWindow(mozIDOMWindowProxy* aParent,
+nsWindowWatcher::OpenWindow(nsPIDOMWindowOuter* aParent,
                             const char* aUrl,
                             const char* aName,
                             const char* aFeatures,
                             nsISupports* aArguments,
-                            mozIDOMWindowProxy** aResult)
+                            nsPIDOMWindowOuter** aResult)
 {
   nsCOMPtr<nsIArray> argv = ConvertArgsToArray(aArguments);
 
   uint32_t argc = 0;
   if (argv) {
     argv->GetLength(&argc);
   }
   bool dialog = (argc != 0);
@@ -380,28 +380,28 @@ struct SizeSpec
   bool SizeSpecified() const
   {
     return mOuterWidthSpecified || mOuterHeightSpecified ||
            mInnerWidthSpecified || mInnerHeightSpecified;
   }
 };
 
 NS_IMETHODIMP
-nsWindowWatcher::OpenWindow2(mozIDOMWindowProxy* aParent,
+nsWindowWatcher::OpenWindow2(nsPIDOMWindowOuter* aParent,
                              const char* aUrl,
                              const char* aName,
                              const char* aFeatures,
                              bool aCalledFromScript,
                              bool aDialog,
                              bool aNavigate,
                              nsISupports* aArguments,
                              bool aIsPopupSpam,
                              bool aForceNoOpener,
                              nsIDocShellLoadInfo* aLoadInfo,
-                             mozIDOMWindowProxy** aResult)
+                             nsPIDOMWindowOuter** aResult)
 {
   nsCOMPtr<nsIArray> argv = ConvertArgsToArray(aArguments);
 
   uint32_t argc = 0;
   if (argv) {
     argv->GetLength(&argc);
   }
 
@@ -448,17 +448,17 @@ CheckUserContextCompatibility(nsIDocShel
   return subjectPrincipal->GetUserContextId() == userContextId;
 }
 
 nsresult
 nsWindowWatcher::CreateChromeWindow(const nsACString& aFeatures,
                                     nsIWebBrowserChrome* aParentChrome,
                                     uint32_t aChromeFlags,
                                     nsITabParent* aOpeningTabParent,
-                                    mozIDOMWindowProxy* aOpener,
+                                    nsPIDOMWindowOuter* aOpener,
                                     uint64_t aNextTabParentId,
                                     nsIWebBrowserChrome** aResult)
 {
   nsCOMPtr<nsIWindowCreator2> windowCreator2(do_QueryInterface(mWindowCreator));
   if (NS_WARN_IF(!windowCreator2)) {
     return NS_ERROR_UNEXPECTED;
   }
 
@@ -626,28 +626,28 @@ nsWindowWatcher::OpenWindowWithTabParent
     return NS_ERROR_UNEXPECTED;
   }
 
   newTabParent.forget(aResult);
   return NS_OK;
 }
 
 nsresult
-nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
+nsWindowWatcher::OpenWindowInternal(nsPIDOMWindowOuter* aParent,
                                     const char* aUrl,
                                     const char* aName,
                                     const char* aFeatures,
                                     bool aCalledFromJS,
                                     bool aDialog,
                                     bool aNavigate,
                                     nsIArray* aArgv,
                                     bool aIsPopupSpam,
                                     bool aForceNoOpener,
                                     nsIDocShellLoadInfo* aLoadInfo,
-                                    mozIDOMWindowProxy** aResult)
+                                    nsPIDOMWindowOuter** aResult)
 {
   nsresult rv = NS_OK;
   bool isNewToplevelWindow = false;
   bool windowIsNew = false;
   bool windowNeedsName = false;
   bool windowIsModal = false;
   bool uriToLoadIsChrome = false;
   bool windowIsModalContentDialog = false;
@@ -815,17 +815,17 @@ nsWindowWatcher::OpenWindowInternal(mozI
         provider = do_GetInterface(parentTreeOwner);
       } else if (XRE_IsContentProcess()) {
         // we're in a content process but we don't have a tabchild we can
         // use.
         provider = nsContentUtils::GetWindowProviderForContentProcess();
       }
 
       if (provider) {
-        nsCOMPtr<mozIDOMWindowProxy> newWindow;
+        nsCOMPtr<nsPIDOMWindowOuter> newWindow;
         rv = provider->ProvideWindow(aParent, chromeFlags, aCalledFromJS,
                                      sizeSpec.PositionSpecified(),
                                      sizeSpec.SizeSpecified(),
                                      uriToLoad, name, features, aForceNoOpener,
                                      aLoadInfo, &windowIsNew,
                                      getter_AddRefs(newWindow));
 
         if (NS_SUCCEEDED(rv)) {
@@ -929,17 +929,17 @@ nsWindowWatcher::OpenWindowInternal(mozI
          is in a situation that's likely to mean this is an unrequested
          popup window we're creating. However we're not completely honest:
          we clear that indicator if the opener is chrome, so that the
          downstream consumer can treat the indicator to mean simply
          that the new window is subject to popup control. */
       nsCOMPtr<nsIWindowCreator2> windowCreator2(
         do_QueryInterface(mWindowCreator));
       if (windowCreator2) {
-        mozIDOMWindowProxy* openerWindow = aForceNoOpener ? nullptr : aParent;
+        nsPIDOMWindowOuter* openerWindow = aForceNoOpener ? nullptr : aParent;
         rv = CreateChromeWindow(features, parentChrome, chromeFlags,
                                 nullptr, openerWindow, 0,
                                 getter_AddRefs(newChrome));
 
       } else {
         rv = mWindowCreator->CreateChromeWindow(parentChrome, chromeFlags,
                                                 getter_AddRefs(newChrome));
       }
@@ -1331,44 +1331,44 @@ nsWindowWatcher::GetWindowEnumerator(nsI
   if (enumerator) {
     return CallQueryInterface(enumerator, aResult);
   }
 
   return NS_ERROR_OUT_OF_MEMORY;
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::GetNewPrompter(mozIDOMWindowProxy* aParent, nsIPrompt** aResult)
+nsWindowWatcher::GetNewPrompter(nsPIDOMWindowOuter* aParent, nsIPrompt** aResult)
 {
   // This is for backwards compat only. Callers should just use the prompt
   // service directly.
   nsresult rv;
   nsCOMPtr<nsIPromptFactory> factory =
     do_GetService("@mozilla.org/prompter;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return factory->GetPrompt(aParent, NS_GET_IID(nsIPrompt),
                             reinterpret_cast<void**>(aResult));
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::GetNewAuthPrompter(mozIDOMWindowProxy* aParent,
+nsWindowWatcher::GetNewAuthPrompter(nsPIDOMWindowOuter* aParent,
                                     nsIAuthPrompt** aResult)
 {
   // This is for backwards compat only. Callers should just use the prompt
   // service directly.
   nsresult rv;
   nsCOMPtr<nsIPromptFactory> factory =
     do_GetService("@mozilla.org/prompter;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   return factory->GetPrompt(aParent, NS_GET_IID(nsIAuthPrompt),
                             reinterpret_cast<void**>(aResult));
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::GetPrompt(mozIDOMWindowProxy* aParent, const nsIID& aIID,
+nsWindowWatcher::GetPrompt(nsPIDOMWindowOuter* aParent, const nsIID& aIID,
                            void** aResult)
 {
   // This is for backwards compat only. Callers should just use the prompt
   // service directly.
   nsresult rv;
   nsCOMPtr<nsIPromptFactory> factory =
     do_GetService("@mozilla.org/prompter;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1399,38 +1399,38 @@ nsWindowWatcher::SetWindowCreator(nsIWin
 NS_IMETHODIMP
 nsWindowWatcher::HasWindowCreator(bool* aResult)
 {
   *aResult = mWindowCreator;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::GetActiveWindow(mozIDOMWindowProxy** aActiveWindow)
+nsWindowWatcher::GetActiveWindow(nsPIDOMWindowOuter** aActiveWindow)
 {
   *aActiveWindow = nullptr;
   nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
   if (fm) {
     return fm->GetActiveWindow(aActiveWindow);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::SetActiveWindow(mozIDOMWindowProxy* aActiveWindow)
+nsWindowWatcher::SetActiveWindow(nsPIDOMWindowOuter* aActiveWindow)
 {
   nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
   if (fm) {
     return fm->SetActiveWindow(aActiveWindow);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::AddWindow(mozIDOMWindowProxy* aWindow, nsIWebBrowserChrome* aChrome)
+nsWindowWatcher::AddWindow(nsPIDOMWindowOuter* aWindow, nsIWebBrowserChrome* aChrome)
 {
   if (!aWindow) {
     return NS_ERROR_INVALID_ARG;
   }
 
   {
     nsWatcherWindowEntry* info;
     MutexAutoLock lock(mListLock);
@@ -1470,17 +1470,17 @@ nsWindowWatcher::AddWindow(mozIDOMWindow
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsISupports> domwin(do_QueryInterface(aWindow));
   return os->NotifyObservers(domwin, "domwindowopened", 0);
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::RemoveWindow(mozIDOMWindowProxy* aWindow)
+nsWindowWatcher::RemoveWindow(nsPIDOMWindowOuter* aWindow)
 {
   // find the corresponding nsWatcherWindowEntry, remove it
 
   if (!aWindow) {
     return NS_ERROR_INVALID_ARG;
   }
 
   nsWatcherWindowEntry* info = FindWindowEntry(aWindow);
@@ -1488,17 +1488,17 @@ nsWindowWatcher::RemoveWindow(mozIDOMWin
     RemoveWindow(info);
     return NS_OK;
   }
   NS_WARNING("requested removal of nonexistent window");
   return NS_ERROR_INVALID_ARG;
 }
 
 nsWatcherWindowEntry*
-nsWindowWatcher::FindWindowEntry(mozIDOMWindowProxy* aWindow)
+nsWindowWatcher::FindWindowEntry(nsPIDOMWindowOuter* aWindow)
 {
   // find the corresponding nsWatcherWindowEntry
   nsWatcherWindowEntry* info;
   nsWatcherWindowEntry* listEnd;
 
   info = mOldestWindow;
   listEnd = 0;
   while (info != listEnd) {
@@ -1538,17 +1538,17 @@ nsWindowWatcher::RemoveWindow(nsWatcherW
     os->NotifyObservers(domwin, "domwindowclosed", 0);
   }
 
   delete aInfo;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWindowWatcher::GetChromeForWindow(mozIDOMWindowProxy* aWindow,
+nsWindowWatcher::GetChromeForWindow(nsPIDOMWindowOuter* aWindow,
                                     nsIWebBrowserChrome** aResult)
 {
   if (!aWindow || !aResult) {
     return NS_ERROR_INVALID_ARG;
   }
   *aResult = 0;
 
   MutexAutoLock lock(mListLock);
@@ -1561,18 +1561,18 @@ nsWindowWatcher::GetChromeForWindow(mozI
     *aResult = info->mChrome;
     NS_IF_ADDREF(*aResult);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindowWatcher::GetWindowByName(const nsAString& aTargetName,
-                                 mozIDOMWindowProxy* aCurrentWindow,
-                                 mozIDOMWindowProxy** aResult)
+                                 nsPIDOMWindowOuter* aCurrentWindow,
+                                 nsPIDOMWindowOuter** aResult)
 {
   if (!aResult) {
     return NS_ERROR_INVALID_ARG;
   }
 
   *aResult = nullptr;
 
   nsPIDOMWindowOuter* currentWindow =
@@ -1611,17 +1611,17 @@ bool
 nsWindowWatcher::RemoveEnumerator(nsWatcherWindowEnumerator* aEnumerator)
 {
   // (requires a lock; assumes it's called by someone holding the lock)
   return mEnumeratorList.RemoveElement(aEnumerator);
 }
 
 nsresult
 nsWindowWatcher::URIfromURL(const char* aURL,
-                            mozIDOMWindowProxy* aParent,
+                            nsPIDOMWindowOuter* aParent,
                             nsIURI** aURI)
 {
   // Build the URI relative to the entry global.
   nsCOMPtr<nsPIDOMWindowInner> baseWindow = do_QueryInterface(GetEntryGlobal());
 
   // failing that, build it relative to the parent window, if possible
   if (!baseWindow && aParent) {
     baseWindow = nsPIDOMWindowOuter::From(aParent)->GetCurrentInnerWindow();
@@ -1765,17 +1765,17 @@ nsWindowWatcher::CalculateChromeFlagsFor
  * @param aDialog affects the assumptions made about unnamed features
  * @param aChromeURL true if the window is being sent to a chrome:// URL
  * @param aHasChromeParent true if the parent window is privileged
  * @param aCalledFromJS true if the window open request came from script.
  * @return the chrome bitmask
  */
 // static
 uint32_t
-nsWindowWatcher::CalculateChromeFlagsForParent(mozIDOMWindowProxy* aParent,
+nsWindowWatcher::CalculateChromeFlagsForParent(nsPIDOMWindowOuter* aParent,
                                                const nsACString& aFeatures,
                                                bool aDialog,
                                                bool aChromeURL,
                                                bool aHasChromeParent,
                                                bool aCalledFromJS)
 {
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(nsContentUtils::LegacyIsCallerChromeOrNativeCode());
@@ -2021,17 +2021,17 @@ nsWindowWatcher::GetCallerTreeItem(nsIDo
   }
 
   return callerItem.forget();
 }
 
 nsPIDOMWindowOuter*
 nsWindowWatcher::SafeGetWindowByName(const nsAString& aName,
                                      bool aForceNoOpener,
-                                     mozIDOMWindowProxy* aCurrentWindow)
+                                     nsPIDOMWindowOuter* aCurrentWindow)
 {
   if (aForceNoOpener) {
     if (!aName.LowerCaseEqualsLiteral("_self") &&
         !aName.LowerCaseEqualsLiteral("_top") &&
         !aName.LowerCaseEqualsLiteral("_parent")) {
       // Ignore all other names in the noopener case.
       return nullptr;
     }
@@ -2060,17 +2060,17 @@ nsWindowWatcher::SafeGetWindowByName(con
    been created. Note it also sets the window's opener to the parent,
    if applicable -- because it's just convenient, that's all. null aParent
    is acceptable. */
 nsresult
 nsWindowWatcher::ReadyOpenedDocShellItem(nsIDocShellTreeItem* aOpenedItem,
                                          nsPIDOMWindowOuter* aParent,
                                          bool aWindowIsNew,
                                          bool aForceNoOpener,
-                                         mozIDOMWindowProxy** aOpenedWindow)
+                                         nsPIDOMWindowOuter** aOpenedWindow)
 {
   nsresult rv = NS_ERROR_FAILURE;
 
   NS_ENSURE_ARG(aOpenedWindow);
 
   *aOpenedWindow = 0;
   nsCOMPtr<nsPIDOMWindowOuter> piOpenedWindow = aOpenedItem->GetWindow();
   if (piOpenedWindow) {
@@ -2094,17 +2094,18 @@ nsWindowWatcher::ReadyOpenedDocShellItem
       NS_ASSERTION(!chan, "Why is there a document channel?");
 #endif
 
       nsCOMPtr<nsIDocument> doc = piOpenedWindow->GetExtantDoc();
       if (doc) {
         doc->SetIsInitialDocument(true);
       }
     }
-    rv = CallQueryInterface(piOpenedWindow, aOpenedWindow);
+    rv = NS_OK;
+    piOpenedWindow.forget(aOpenedWindow);
   }
   return rv;
 }
 
 // static
 void
 nsWindowWatcher::CalcSizeSpec(const nsACString& aFeatures, SizeSpec& aResult)
 {
@@ -2182,17 +2183,17 @@ nsWindowWatcher::CalcSizeSpec(const nsAC
           True if the code requesting the new window is privileged.
    @param aSizeSpec
           The size that the new window should be.
    @param aOpenerFullZoom
           If not nothing, a zoom factor to scale the content to.
 */
 void
 nsWindowWatcher::SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
-                                  mozIDOMWindowProxy* aParent,
+                                  nsPIDOMWindowOuter* aParent,
                                   bool aIsCallerChrome,
                                   const SizeSpec& aSizeSpec,
                                   const Maybe<float>& aOpenerFullZoom)
 {
   // We should only be sizing top-level windows if we're in the parent
   // process.
   MOZ_ASSERT(XRE_IsParentProcess());
 
@@ -2451,17 +2452,17 @@ nsWindowWatcher::SizeOpenedWindow(nsIDoc
       }
       treeOwnerAsWin->SetSize(width * scale, height * scale, false);
     }
   }
   treeOwnerAsWin->SetVisibility(true);
 }
 
 void
-nsWindowWatcher::GetWindowTreeItem(mozIDOMWindowProxy* aWindow,
+nsWindowWatcher::GetWindowTreeItem(nsPIDOMWindowOuter* aWindow,
                                    nsIDocShellTreeItem** aResult)
 {
   *aResult = 0;
 
   if (aWindow) {
     nsIDocShell* docshell = nsPIDOMWindowOuter::From(aWindow)->GetDocShell();
     if (docshell) {
       CallQueryInterface(docshell, aResult);
--- a/toolkit/components/windowwatcher/nsWindowWatcher.h
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.h
@@ -56,85 +56,85 @@ public:
 
 protected:
   virtual ~nsWindowWatcher();
 
   friend class nsPromptService;
   bool AddEnumerator(nsWatcherWindowEnumerator* aEnumerator);
   bool RemoveEnumerator(nsWatcherWindowEnumerator* aEnumerator);
 
-  nsWatcherWindowEntry* FindWindowEntry(mozIDOMWindowProxy* aWindow);
+  nsWatcherWindowEntry* FindWindowEntry(nsPIDOMWindowOuter* aWindow);
   nsresult RemoveWindow(nsWatcherWindowEntry* aInfo);
 
   // Get the caller tree item.  Look on the JS stack, then fall back
   // to the parent if there's nothing there.
   already_AddRefed<nsIDocShellTreeItem> GetCallerTreeItem(
     nsIDocShellTreeItem* aParentItem);
 
   // Unlike GetWindowByName this will look for a caller on the JS
   // stack, and then fall back on aCurrentWindow if it can't find one.
   // It also knows to not look for things if aForceNoOpener is set.
   nsPIDOMWindowOuter* SafeGetWindowByName(const nsAString& aName,
                                           bool aForceNoOpener,
-                                          mozIDOMWindowProxy* aCurrentWindow);
+                                          nsPIDOMWindowOuter* aCurrentWindow);
 
   // Just like OpenWindowJS, but knows whether it got called via OpenWindowJS
   // (which means called from script) or called via OpenWindow.
-  nsresult OpenWindowInternal(mozIDOMWindowProxy* aParent,
+  nsresult OpenWindowInternal(nsPIDOMWindowOuter* aParent,
                               const char* aUrl,
                               const char* aName,
                               const char* aFeatures,
                               bool aCalledFromJS,
                               bool aDialog,
                               bool aNavigate,
                               nsIArray* aArgv,
                               bool aIsPopupSpam,
                               bool aForceNoOpener,
                               nsIDocShellLoadInfo* aLoadInfo,
-                              mozIDOMWindowProxy** aResult);
+                              nsPIDOMWindowOuter** aResult);
 
   static nsresult URIfromURL(const char* aURL,
-                             mozIDOMWindowProxy* aParent,
+                             nsPIDOMWindowOuter* aParent,
                              nsIURI** aURI);
 
   static uint32_t CalculateChromeFlagsForChild(const nsACString& aFeaturesStr);
 
-  static uint32_t CalculateChromeFlagsForParent(mozIDOMWindowProxy* aParent,
+  static uint32_t CalculateChromeFlagsForParent(nsPIDOMWindowOuter* aParent,
                                                 const nsACString& aFeaturesStr,
                                                 bool aDialog,
                                                 bool aChromeURL,
                                                 bool aHasChromeParent,
                                                 bool aCalledFromJS);
 
   static int32_t WinHasOption(const nsACString& aOptions, const char* aName,
                               int32_t aDefault, bool* aPresenceFlag);
   /* Compute the right SizeSpec based on aFeatures */
   static void CalcSizeSpec(const nsACString& aFeatures, SizeSpec& aResult);
   static nsresult ReadyOpenedDocShellItem(nsIDocShellTreeItem* aOpenedItem,
                                           nsPIDOMWindowOuter* aParent,
                                           bool aWindowIsNew,
                                           bool aForceNoOpener,
-                                          mozIDOMWindowProxy** aOpenedWindow);
+                                          nsPIDOMWindowOuter** aOpenedWindow);
   static void SizeOpenedWindow(nsIDocShellTreeOwner* aTreeOwner,
-                               mozIDOMWindowProxy* aParent,
+                               nsPIDOMWindowOuter* aParent,
                                bool aIsCallerChrome,
                                const SizeSpec& aSizeSpec,
                                const mozilla::Maybe<float>& aOpenerFullZoom =
                                  mozilla::Nothing());
-  static void GetWindowTreeItem(mozIDOMWindowProxy* aWindow,
+  static void GetWindowTreeItem(nsPIDOMWindowOuter* aWindow,
                                 nsIDocShellTreeItem** aResult);
   static void GetWindowTreeOwner(nsPIDOMWindowOuter* aWindow,
                                  nsIDocShellTreeOwner** aResult);
 
 private:
   nsresult CreateChromeWindow(const nsACString& aFeatures,
                               nsIWebBrowserChrome* aParentChrome,
                               uint32_t aChromeFlags,
                               nsITabParent* aOpeningTabParent,
-                              mozIDOMWindowProxy* aOpener,
+                              nsPIDOMWindowOuter* aOpener,
                               uint64_t aNextTabParentId,
                               nsIWebBrowserChrome** aResult);
 
   void MaybeDisablePersistence(const nsACString& aFeatures,
                                nsIDocShellTreeOwner* aTreeOwner);
 
   static uint32_t CalculateChromeFlagsHelper(uint32_t aInitialFlags,
                                              const nsACString& aFeatures,
--- a/toolkit/modules/sessionstore/Utils.jsm
+++ b/toolkit/modules/sessionstore/Utils.jsm
@@ -151,18 +151,18 @@ var Utils = Object.freeze({
     }
     return null;
   },
 
   /**
    * A function that will recursively call |cb| to collect data for all
    * non-dynamic frames in the current frame/docShell tree.
    *
-   * @param {mozIDOMWindowProxy} frame A DOM window or content frame for which
-   *                                   data will be collected.
+   * @param {Window} frame A DOM window or content frame for which
+   *                       data will be collected.
    * @param {...function} dataCollectors One or more data collection functions
    *                                     that will be called once for each non-
    *                                     dynamic frame in the given frame tree,
    *                                     and which should return the data they
    *                                     wish to save for that respective frame.
    * @return {object[]} An array with one entry per dataCollector, containing
    *                    the collected data as a nested data structure according
    *                    to the layout of the frame tree, or null if no data was
--- a/toolkit/xre/ProfileReset.cpp
+++ b/toolkit/xre/ProfileReset.cpp
@@ -138,17 +138,17 @@ ProfileResetCleanup(nsIToolkitProfile* a
 
   // Show a progress window while the cleanup happens since the disk I/O can take time.
   nsCOMPtr<nsIWindowWatcher> windowWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
   if (!windowWatcher) return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIAppStartup> appStartup(do_GetService(NS_APPSTARTUP_CONTRACTID));
   if (!appStartup) return NS_ERROR_FAILURE;
 
-  nsCOMPtr<mozIDOMWindowProxy> progressWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> progressWindow;
   rv = windowWatcher->OpenWindow(nullptr,
                                  kResetProgressURL,
                                  "_blank",
                                  "centerscreen,chrome,titlebar",
                                  nullptr,
                                  getter_AddRefs(progressWindow));
   if (NS_FAILED(rv)) return rv;
 
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -2125,17 +2125,17 @@ ShowProfileManager(nsIToolkitProfileServ
       NS_ENSURE_TRUE(windowWatcher && ioParamBlock && dlgArray, NS_ERROR_FAILURE);
 
       ioParamBlock->SetObjects(dlgArray);
 
       nsCOMPtr<nsIAppStartup> appStartup
         (do_GetService(NS_APPSTARTUP_CONTRACTID));
       NS_ENSURE_TRUE(appStartup, NS_ERROR_FAILURE);
 
-      nsCOMPtr<mozIDOMWindowProxy> newWindow;
+      nsCOMPtr<nsPIDOMWindowOuter> newWindow;
       rv = windowWatcher->OpenWindow(nullptr,
                                      kProfileManagerURL,
                                      "_blank",
                                      "centerscreen,chrome,modal,titlebar",
                                      ioParamBlock,
                                      getter_AddRefs(newWindow));
 
       NS_ENSURE_SUCCESS_LOG(rv, rv);
--- a/toolkit/xre/nsNativeAppSupportCocoa.mm
+++ b/toolkit/xre/nsNativeAppSupportCocoa.mm
@@ -11,31 +11,31 @@
 #include "nsCOMPtr.h"
 #include "nsCocoaFeatures.h"
 #include "nsNativeAppSupportBase.h"
 
 #include "nsIAppShellService.h"
 #include "nsIAppStartup.h"
 #include "nsIBaseWindow.h"
 #include "nsICommandLineRunner.h"
-#include "mozIDOMWindow.h"
+#include "nsPIDOMWindow.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIObserver.h"
 #include "nsIServiceManager.h"
 #include "nsIWebNavigation.h"
 #include "nsIWidget.h"
 #include "nsIWindowMediator.h"
 
 // This must be included last:
 #include "nsObjCExceptions.h"
 
 nsresult
-GetNativeWindowPointerFromDOMWindow(mozIDOMWindowProxy *a_window, NSWindow **a_nativeWindow)
+GetNativeWindowPointerFromDOMWindow(nsPIDOMWindowOuter *a_window, NSWindow **a_nativeWindow)
 {
   *a_nativeWindow = nil;
   if (!a_window)
     return NS_ERROR_INVALID_ARG;
 
   nsCOMPtr<nsIWebNavigation> mruWebNav(do_GetInterface(a_window));
   if (mruWebNav) {
     nsCOMPtr<nsIDocShellTreeItem> mruTreeItem(do_QueryInterface(mruWebNav));
@@ -145,17 +145,17 @@ nsNativeAppSupportCocoa::ReOpen()
         haveNonMiniaturized = true;
         break;  //have un-minimized windows, nothing to do
       }
       windowList->HasMoreElements(&more);
     } // end while
 
     if (!haveNonMiniaturized) {
       // Deminiaturize the most recenty used window
-      nsCOMPtr<mozIDOMWindowProxy> mru;
+      nsCOMPtr<nsPIDOMWindowOuter> mru;
       wm->GetMostRecentWindow(nullptr, getter_AddRefs(mru));
 
       if (mru) {
         NSWindow *cocoaMru = nil;
         GetNativeWindowPointerFromDOMWindow(mru, &cocoaMru);
         if (cocoaMru) {
           [cocoaMru deminiaturize:nil];
           done = true;
--- a/toolkit/xre/nsNativeAppSupportWin.cpp
+++ b/toolkit/xre/nsNativeAppSupportWin.cpp
@@ -48,35 +48,35 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <io.h>
 #include <direct.h>
 #include <fcntl.h>
 
 using namespace mozilla;
 
-static HWND hwndForDOMWindow( mozIDOMWindowProxy * );
+static HWND hwndForDOMWindow( nsPIDOMWindowOuter * );
 
 static
 nsresult
-GetMostRecentWindow(const char16_t* aType, mozIDOMWindowProxy** aWindow) {
+GetMostRecentWindow(const char16_t* aType, nsPIDOMWindowOuter** aWindow) {
     nsresult rv;
     nsCOMPtr<nsIWindowMediator> med( do_GetService( NS_WINDOWMEDIATOR_CONTRACTID, &rv ) );
     if ( NS_FAILED( rv ) )
         return rv;
 
     if ( med )
         return med->GetMostRecentWindow( aType, aWindow );
 
     return NS_ERROR_FAILURE;
 }
 
 static
 void
-activateWindow( mozIDOMWindowProxy *win ) {
+activateWindow( nsPIDOMWindowOuter *win ) {
     // Try to get native window handle.
     HWND hwnd = hwndForDOMWindow( win );
     if ( hwnd ) {
         // Restore the window if it is minimized.
         if ( ::IsIconic( hwnd ) ) {
             ::ShowWindow( hwnd, SW_RESTORE );
         }
         // Use the OS call, if possible.
@@ -567,17 +567,17 @@ struct MessageWindow {
 
                 NS_NewLocalFile(NS_ConvertUTF8toUTF16(wdpath),
                                 false,
                                 getter_AddRefs(workingDir));
             }
             (void)nsNativeAppSupportWin::HandleCommandLine((char*)cds->lpData, workingDir, nsICommandLine::STATE_REMOTE_AUTO);
 
             // Get current window and return its window handle.
-            nsCOMPtr<mozIDOMWindowProxy> win;
+            nsCOMPtr<nsPIDOMWindowOuter> win;
             GetMostRecentWindow( 0, getter_AddRefs( win ) );
             return win ? (LRESULT)hwndForDOMWindow( win ) : 0;
         }
         return DefWindowProc( msgWindow, msg, wp, lp );
     }
 
 private:
     HWND mHandle;
@@ -948,17 +948,17 @@ nsNativeAppSupportWin::HandleDDENotifica
                     // "Window ID" however the window ID is not used for this
                     // command, therefore it is returned as a null string
 
                     // This isn't really a loop.  We just use "break"
                     // statements to bypass the remaining steps when
                     // something goes wrong.
                     do {
                         // Get most recently used Nav window.
-                        nsCOMPtr<mozIDOMWindowProxy> navWin;
+                        nsCOMPtr<nsPIDOMWindowOuter> navWin;
                         GetMostRecentWindow( u"navigator:browser",
                                              getter_AddRefs( navWin ) );
                         nsCOMPtr<nsPIDOMWindowOuter> piNavWin = do_QueryInterface(navWin);
                         if ( !piNavWin ) {
                             // There is not a window open
                             break;
                         }
 
@@ -1202,17 +1202,17 @@ HDDEDATA nsNativeAppSupportWin::CreateDD
                                            0,
                                            mApplication,
                                            CF_TEXT,
                                            0 );
     return result;
 }
 
 void nsNativeAppSupportWin::ActivateLastWindow() {
-    nsCOMPtr<mozIDOMWindowProxy> navWin;
+    nsCOMPtr<nsPIDOMWindowOuter> navWin;
     GetMostRecentWindow( u"navigator:browser", getter_AddRefs( navWin ) );
     if ( navWin ) {
         // Activate that window.
         activateWindow( navWin );
     } else {
         // Need to create a Navigator window, then.
         OpenBrowserWindow();
     }
@@ -1386,28 +1386,28 @@ nsNativeAppSupportWin::OpenWindow( const
   nsresult rv = NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
   nsCOMPtr<nsISupportsCString> sarg(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
   if (sarg)
     sarg->SetData(nsDependentCString(args));
 
   if (wwatch && sarg) {
-    nsCOMPtr<mozIDOMWindowProxy> newWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> newWindow;
     rv = wwatch->OpenWindow(0, urlstr, "_blank", "chrome,dialog=no,all",
                    sarg, getter_AddRefs(newWindow));
 #if MOZ_DEBUG_DDE
   } else {
       printf("Get WindowWatcher (or create string) failed\n");
 #endif
   }
   return rv;
 }
 
-HWND hwndForDOMWindow(mozIDOMWindowProxy *window ) {
+HWND hwndForDOMWindow(nsPIDOMWindowOuter *window ) {
     if ( !window ) {
         return 0;
     }
     nsCOMPtr<nsPIDOMWindowOuter > pidomwindow = nsPIDOMWindowOuter::From(window);
 
     nsCOMPtr<nsIBaseWindow> ppBaseWindow =
         do_QueryInterface( pidomwindow->GetDocShell() );
     if ( !ppBaseWindow ) {
@@ -1426,17 +1426,17 @@ nsNativeAppSupportWin::OpenBrowserWindow
     nsresult rv = NS_OK;
 
     // Open the argument URL in the most recently used Navigator window.
     // If there is no Nav window, open a new one.
 
     // If at all possible, hand the request off to the most recent
     // browser window.
 
-    nsCOMPtr<mozIDOMWindowProxy> navWin;
+    nsCOMPtr<nsPIDOMWindowOuter> navWin;
     GetMostRecentWindow( u"navigator:browser", getter_AddRefs( navWin ) );
 
     // This isn't really a loop.  We just use "break" statements to fall
     // out to the OpenWindow call when things go awry.
     do {
         // If caller requires a new window, then don't use an existing one.
         if ( !navWin ) {
             // Have to open a new one.
@@ -1456,17 +1456,17 @@ nsNativeAppSupportWin::OpenBrowserWindow
             if ( chromeWin )
               chromeWin->GetBrowserDOMWindow( getter_AddRefs ( bwin ) );
           }
         }
         if ( bwin ) {
           nsCOMPtr<nsIURI> uri;
           NS_NewURI( getter_AddRefs( uri ), NS_LITERAL_CSTRING("about:blank"), 0, 0 );
           if ( uri ) {
-            nsCOMPtr<mozIDOMWindowProxy> container;
+            nsCOMPtr<nsPIDOMWindowOuter> container;
             rv = bwin->OpenURI( uri, 0,
                                 nsIBrowserDOMWindow::OPEN_DEFAULTWINDOW,
                                 nsIBrowserDOMWindow::OPEN_EXTERNAL,
                                 nsContentUtils::GetSystemPrincipal(),
                                 getter_AddRefs( container ) );
             if ( NS_SUCCEEDED( rv ) )
               return NS_OK;
           }
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -892,43 +892,43 @@ nsDocLoader::AddProgressListener(nsIWebP
 
 NS_IMETHODIMP
 nsDocLoader::RemoveProgressListener(nsIWebProgressListener *aListener)
 {
   return mListenerInfoList.RemoveElement(aListener) ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsDocLoader::GetDOMWindow(mozIDOMWindowProxy **aResult)
+nsDocLoader::GetDOMWindow(nsPIDOMWindowOuter **aResult)
 {
   return CallGetInterface(this, aResult);
 }
 
 NS_IMETHODIMP
 nsDocLoader::GetDOMWindowID(uint64_t *aResult)
 {
   *aResult = 0;
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   nsresult rv = GetDOMWindow(getter_AddRefs(window));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsPIDOMWindowOuter> piwindow = nsPIDOMWindowOuter::From(window);
   NS_ENSURE_STATE(piwindow);
 
   *aResult = piwindow->WindowID();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocLoader::GetInnerDOMWindowID(uint64_t *aResult)
 {
   *aResult = 0;
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   nsresult rv = GetDOMWindow(getter_AddRefs(window));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsPIDOMWindowOuter> outer = nsPIDOMWindowOuter::From(window);
   NS_ENSURE_STATE(outer);
 
   nsPIDOMWindowInner* inner = outer->GetCurrentInnerWindow();
   if (!inner) {
@@ -940,17 +940,17 @@ nsDocLoader::GetInnerDOMWindowID(uint64_
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDocLoader::GetIsTopLevel(bool *aResult)
 {
   *aResult = false;
 
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   GetDOMWindow(getter_AddRefs(window));
   if (window) {
     nsCOMPtr<nsPIDOMWindowOuter> piwindow = nsPIDOMWindowOuter::From(window);
     NS_ENSURE_STATE(piwindow);
 
     nsCOMPtr<nsPIDOMWindowOuter> topWindow = piwindow->GetTop();
     *aResult = piwindow == topWindow;
   }
@@ -972,17 +972,17 @@ nsDocLoader::GetLoadType(uint32_t *aLoad
   *aLoadType = 0;
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsDocLoader::GetTarget(nsIEventTarget** aTarget)
 {
-  nsCOMPtr<mozIDOMWindowProxy> window;
+  nsCOMPtr<nsPIDOMWindowOuter> window;
   nsresult rv = GetDOMWindow(getter_AddRefs(window));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(window);
   NS_ENSURE_STATE(global);
 
   nsCOMPtr<nsIEventTarget> target = global->EventTargetFor(mozilla::TaskCategory::Other);
   target.forget(aTarget);
--- a/uriloader/base/nsIWebProgress.idl
+++ b/uriloader/base/nsIWebProgress.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIEventTarget;
 interface nsIWebProgressListener;
 
 /**
  * The nsIWebProgress interface is used to add or remove nsIWebProgressListener
  * instances to observe the loading of asynchronous requests (usually in the
  * context of a DOM window).
  *
@@ -127,17 +127,17 @@ interface nsIWebProgress : nsISupports
   void removeProgressListener(in nsIWebProgressListener aListener);
 
   /**
    * The DOM window associated with this nsIWebProgress instance.
    *
    * @throw NS_ERROR_FAILURE
    *        Indicates that there is no associated DOM window.
    */
-  readonly attribute mozIDOMWindowProxy DOMWindow;
+  readonly attribute WindowProxy DOMWindow;
   readonly attribute uint64_t DOMWindowID;
   readonly attribute uint64_t innerDOMWindowID;
 
   /**
    * Indicates whether DOMWindow.top == DOMWindow.
    */
   readonly attribute boolean isTopLevel;
 
--- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp
+++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp
@@ -193,23 +193,23 @@ OfflineCacheUpdateParent::ApplicationCac
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // OfflineCacheUpdateParent::nsILoadContext
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
-OfflineCacheUpdateParent::GetAssociatedWindow(mozIDOMWindowProxy** aAssociatedWindow)
+OfflineCacheUpdateParent::GetAssociatedWindow(nsPIDOMWindowOuter** aAssociatedWindow)
 {
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-OfflineCacheUpdateParent::GetTopWindow(mozIDOMWindowProxy** aTopWindow)
+OfflineCacheUpdateParent::GetTopWindow(nsPIDOMWindowOuter** aTopWindow)
 {
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 OfflineCacheUpdateParent::GetTopFrameElement(dom::Element** aElement)
 {
     return NS_ERROR_NOT_IMPLEMENTED;
--- a/uriloader/prefetch/nsIOfflineCacheUpdate.idl
+++ b/uriloader/prefetch/nsIOfflineCacheUpdate.idl
@@ -1,16 +1,16 @@
 /* -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindow;
+webidl Window;
 interface nsIURI;
 interface nsIDOMNode;
 interface nsIOfflineCacheUpdate;
 interface nsIPrincipal;
 interface nsIPrefBranch;
 interface nsIApplicationCache;
 interface nsIFile;
 interface nsIObserver;
@@ -215,17 +215,17 @@ interface nsIOfflineCacheUpdateService :
     /**
      * Schedule a cache update for a given offline manifest.  If an
      * existing update is scheduled or running, that update will be returned.
      * Otherwise a new update will be scheduled.
      */
     nsIOfflineCacheUpdate scheduleUpdate(in nsIURI aManifestURI,
                                          in nsIURI aDocumentURI,
                                          in nsIPrincipal aLoadingPrincipal,
-                                         in mozIDOMWindow aWindow);
+                                         in Window aWindow);
 
     /**
      * Schedule a cache update for a given offline manifest using app cache
      * bound to the given appID+inIsolatedMozBrowser flag.  If an existing update
      * is scheduled or running, that update will be returned. Otherwise a new
      * update will be scheduled.
      */
     nsIOfflineCacheUpdate scheduleAppUpdate(in nsIURI aManifestURI,
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -161,17 +161,17 @@ nsOfflineCachePendingUpdate::OnStateChan
         NS_RELEASE_THIS();
         return NS_OK;
     }
 
     if (!(progressStateFlags & STATE_STOP)) {
         return NS_OK;
     }
 
-    nsCOMPtr<mozIDOMWindowProxy> windowProxy;
+    nsCOMPtr<nsPIDOMWindowOuter> windowProxy;
     aWebProgress->GetDOMWindow(getter_AddRefs(windowProxy));
     if (!windowProxy) return NS_OK;
 
     auto* outerWindow = nsPIDOMWindowOuter::From(windowProxy);
     nsPIDOMWindowInner* innerWindow = outerWindow->GetCurrentInnerWindow();
 
     nsCOMPtr<nsIDocument> progressDoc = outerWindow->GetDoc();
     if (!progressDoc) return NS_OK;
@@ -521,17 +521,17 @@ nsOfflineCacheUpdateService::Schedule(ns
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsOfflineCacheUpdateService::ScheduleUpdate(nsIURI *aManifestURI,
                                             nsIURI *aDocumentURI,
                                             nsIPrincipal* aLoadingPrincipal,
-                                            mozIDOMWindow* aWindow,
+                                            nsPIDOMWindowInner* aWindow,
                                             nsIOfflineCacheUpdate **aUpdate)
 {
     return Schedule(aManifestURI, aDocumentURI, aLoadingPrincipal, nullptr,
                     nsPIDOMWindowInner::From(aWindow), nullptr, aUpdate);
 }
 
 NS_IMETHODIMP
 nsOfflineCacheUpdateService::ScheduleAppUpdate(nsIURI *aManifestURI,
--- a/widget/android/AndroidBridge.cpp
+++ b/widget/android/AndroidBridge.cpp
@@ -669,23 +669,23 @@ nsAndroidBridge::nsAndroidBridge() :
 
   AddObservers();
 }
 
 nsAndroidBridge::~nsAndroidBridge()
 {
 }
 
-NS_IMETHODIMP nsAndroidBridge::ContentDocumentChanged(mozIDOMWindowProxy* aWindow)
+NS_IMETHODIMP nsAndroidBridge::ContentDocumentChanged(nsPIDOMWindowOuter* aWindow)
 {
     AndroidBridge::Bridge()->ContentDocumentChanged(aWindow);
     return NS_OK;
 }
 
-NS_IMETHODIMP nsAndroidBridge::IsContentDocumentDisplayed(mozIDOMWindowProxy* aWindow,
+NS_IMETHODIMP nsAndroidBridge::IsContentDocumentDisplayed(nsPIDOMWindowOuter* aWindow,
                                                           bool *aRet)
 {
     *aRet = AndroidBridge::Bridge()->IsContentDocumentDisplayed(aWindow);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAndroidBridge::Observe(nsISupports* aSubject, const char* aTopic,
@@ -825,39 +825,39 @@ NS_IMETHODIMP nsAndroidBridge::SetBrowse
 }
 
 extern "C"
 __attribute__ ((visibility("default")))
 jobject JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_allocateDirectBuffer(JNIEnv *env, jclass, jlong size);
 
 static RefPtr<nsWindow>
-GetWidget(mozIDOMWindowProxy* aWindow)
+GetWidget(nsPIDOMWindowOuter* aWindow)
 {
     MOZ_ASSERT(aWindow);
 
     nsCOMPtr<nsPIDOMWindowOuter> domWindow = nsPIDOMWindowOuter::From(aWindow);
     nsCOMPtr<nsIWidget> widget =
             widget::WidgetUtils::DOMWindowToWidget(domWindow);
     MOZ_ASSERT(widget);
 
     return RefPtr<nsWindow>(static_cast<nsWindow*>(widget.get()));
 }
 
 void
-AndroidBridge::ContentDocumentChanged(mozIDOMWindowProxy* aWindow)
+AndroidBridge::ContentDocumentChanged(nsPIDOMWindowOuter* aWindow)
 {
     auto widget = GetWidget(aWindow);
     if (widget) {
         widget->SetContentDocumentDisplayed(false);
     }
 }
 
 bool
-AndroidBridge::IsContentDocumentDisplayed(mozIDOMWindowProxy* aWindow)
+AndroidBridge::IsContentDocumentDisplayed(nsPIDOMWindowOuter* aWindow)
 {
     auto widget = GetWidget(aWindow);
     if (widget) {
         return widget->IsContentDocumentDisplayed();
     }
     return false;
 }
 
--- a/widget/android/AndroidBridge.h
+++ b/widget/android/AndroidBridge.h
@@ -90,18 +90,18 @@ public:
 
     static void ConstructBridge();
     static void DeconstructBridge();
 
     static AndroidBridge *Bridge() {
         return sBridge;
     }
 
-    void ContentDocumentChanged(mozIDOMWindowProxy* aDOMWindow);
-    bool IsContentDocumentDisplayed(mozIDOMWindowProxy* aDOMWindow);
+    void ContentDocumentChanged(nsPIDOMWindowOuter* aDOMWindow);
+    bool IsContentDocumentDisplayed(nsPIDOMWindowOuter* aDOMWindow);
 
     bool GetHandlersForURL(const nsAString& aURL,
                            nsIMutableArray* handlersArray = nullptr,
                            nsIHandlerApp **aDefaultApp = nullptr,
                            const nsAString& aAction = EmptyString());
 
     bool GetHandlersForMimeType(const nsAString& aMimeType,
                                 nsIMutableArray* handlersArray = nullptr,
--- a/widget/android/fennec/ThumbnailHelper.h
+++ b/widget/android/fennec/ThumbnailHelper.h
@@ -5,51 +5,50 @@
 
 #ifndef ThumbnailHelper_h
 #define ThumbnailHelper_h
 
 #include "AndroidBridge.h"
 #include "FennecJNINatives.h"
 #include "gfxPlatform.h"
 #include "mozilla/dom/DOMRect.h"
-#include "mozIDOMWindow.h"
+#include "nsPIDOMWindow.h"
 #include "nsAppShell.h"
 #include "nsCOMPtr.h"
 #include "nsIChannel.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsIDocShell.h"
 #include "nsIHttpChannel.h"
 #include "nsIPresShell.h"
 #include "nsIURI.h"
-#include "nsPIDOMWindow.h"
 #include "nsPresContext.h"
 
 #include "mozilla/Preferences.h"
 
 namespace mozilla {
 
 class ThumbnailHelper final
     : public java::ThumbnailHelper::Natives<ThumbnailHelper>
 {
     ThumbnailHelper() = delete;
 
-    static already_AddRefed<mozIDOMWindowProxy>
+    static already_AddRefed<nsPIDOMWindowOuter>
     GetWindowForTab(int32_t aTabId)
     {
         nsAppShell* const appShell = nsAppShell::Get();
         if (!appShell) {
             return nullptr;
         }
 
         nsCOMPtr<nsIAndroidBrowserApp> browserApp = appShell->GetBrowserApp();
         if (!browserApp) {
             return nullptr;
         }
 
-        nsCOMPtr<mozIDOMWindowProxy> window;
+        nsCOMPtr<nsPIDOMWindowOuter> window;
         nsCOMPtr<nsIBrowserTab> tab;
 
         if (NS_FAILED(browserApp->GetBrowserTab(aTabId, getter_AddRefs(tab))) ||
                 !tab ||
                 NS_FAILED(tab->GetWindow(getter_AddRefs(window))) ||
                 !window) {
             return nullptr;
         }
@@ -116,17 +115,17 @@ class ThumbnailHelper final
             // Allow no cache-control, or public cache-control.
             return true;
         }
         return false;
     }
 
     // Return a non-null nsIDocShell to indicate success.
     static already_AddRefed<nsIDocShell>
-    GetThumbnailAndDocShell(mozIDOMWindowProxy* aWindow,
+    GetThumbnailAndDocShell(nsPIDOMWindowOuter* aWindow,
                             jni::ByteBuffer::Param aData,
                             int32_t aThumbWidth, int32_t aThumbHeight,
                             const CSSRect& aPageRect, float aZoomFactor)
     {
         nsCOMPtr<nsPIDOMWindowOuter> win = nsPIDOMWindowOuter::From(aWindow);
         nsCOMPtr<nsIDocShell> docShell = win->GetDocShell();
         RefPtr<nsPresContext> presContext;
 
@@ -226,17 +225,17 @@ public:
 
         NS_DispatchToMainThread(new IdleEvent(Move(aCall)));
     }
 
     static void
     RequestThumbnail(jni::ByteBuffer::Param aData, jni::Object::Param aTab,
                      int32_t aTabId, int32_t aWidth, int32_t aHeight)
     {
-        nsCOMPtr<mozIDOMWindowProxy> window = GetWindowForTab(aTabId);
+        nsCOMPtr<nsPIDOMWindowOuter> window = GetWindowForTab(aTabId);
         if (!window || !aData) {
             java::ThumbnailHelper::NotifyThumbnail(
                     aData, aTab, /* success */ false, /* store */ false);
             return;
         }
 
         // take a screenshot, as wide as possible, proportional to the destination size
         nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
--- a/widget/android/nsIAndroidBridge.idl
+++ b/widget/android/nsIAndroidBridge.idl
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 [scriptable, uuid(e8420a7b-659b-4325-968b-a114a6a067aa)]
 interface nsIBrowserTab : nsISupports {
-  readonly attribute mozIDOMWindowProxy window;
+  readonly attribute WindowProxy window;
 };
 
 [scriptable, uuid(08426a73-e70b-4680-9282-630932e2b2bb)]
 interface nsIUITelemetryObserver : nsISupports {
   void startSession(in wstring name,
                     in long long timestamp);
   void stopSession(in wstring name,
                    in wstring reason,
@@ -73,11 +73,11 @@ interface nsIAndroidView : nsIAndroidEve
 {
   [implicit_jscontext] readonly attribute jsval initData;
 };
 
 [scriptable, uuid(1beb70d3-70f3-4742-98cc-a3d301b26c0c)]
 interface nsIAndroidBridge : nsIAndroidEventDispatcher
 {
   attribute nsIAndroidBrowserApp browserApp;
-  void contentDocumentChanged(in mozIDOMWindowProxy window);
-  boolean isContentDocumentDisplayed(in mozIDOMWindowProxy window);
+  void contentDocumentChanged(in WindowProxy window);
+  boolean isContentDocumentDisplayed(in WindowProxy window);
 };
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1170,17 +1170,17 @@ nsWindow::GeckoViewSupport::Open(const j
     androidView->mEventDispatcher->Attach(
             java::EventDispatcher::Ref::From(aDispatcher), nullptr);
     androidView->mInitData = java::GeckoBundle::Ref::From(aInitData);
 
     nsAutoCString chromeFlags("chrome,dialog=0,resizable,scrollbars");
     if (aPrivateMode) {
         chromeFlags += ",private";
     }
-    nsCOMPtr<mozIDOMWindowProxy> domWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> domWindow;
     ww->OpenWindow(nullptr, url.get(), aId->ToCString().get(), chromeFlags.get(),
                    androidView, getter_AddRefs(domWindow));
     MOZ_RELEASE_ASSERT(domWindow);
 
     nsCOMPtr<nsPIDOMWindowOuter> pdomWindow =
             nsPIDOMWindowOuter::From(domWindow);
     nsCOMPtr<nsIWidget> widget = WidgetUtils::DOMWindowToWidget(pdomWindow);
     MOZ_ASSERT(widget);
@@ -1730,17 +1730,17 @@ nsWindow::SetFocus(bool aRaise)
 void
 nsWindow::BringToFront()
 {
     // If the window to be raised is the same as the currently raised one,
     // do nothing. We need to check the focus manager as well, as the first
     // window that is created will be first in the window list but won't yet
     // be focused.
     nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
-    nsCOMPtr<mozIDOMWindowProxy> existingTopWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> existingTopWindow;
     fm->GetActiveWindow(getter_AddRefs(existingTopWindow));
     if (existingTopWindow && FindTopLevel() == nsWindow::TopWindow())
         return;
 
     if (!IsTopLevel()) {
         FindTopLevel()->BringToFront();
         return;
     }
--- a/widget/cocoa/nsColorPicker.h
+++ b/widget/cocoa/nsColorPicker.h
@@ -7,26 +7,26 @@
 #ifndef nsColorPicker_h_
 #define nsColorPicker_h_
 
 #include "nsIColorPicker.h"
 #include "nsString.h"
 #include "nsCOMPtr.h"
 
 class nsIColorPickerShownCallback;
-class mozIDOMWindowProxy;
+class nsPIDOMWindowOuter;
 @class NSColorPanelWrapper;
 @class NSColor;
 
 class nsColorPicker final : public nsIColorPicker
 {
 public:
   NS_DECL_ISUPPORTS
 
-  NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
+  NS_IMETHOD Init(nsPIDOMWindowOuter* aParent, const nsAString& aTitle,
                   const nsAString& aInitialColor) override;
   NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback) override;
 
   // For NSColorPanelWrapper.
   void Update(NSColor* aColor);
   // Call this method if you are done with this input, but the color picker needs to
   // stay open as it will be associated to another input
   void DoneWithRetarget();
--- a/widget/cocoa/nsColorPicker.mm
+++ b/widget/cocoa/nsColorPicker.mm
@@ -95,17 +95,17 @@ NS_IMPL_ISUPPORTS(nsColorPicker, nsIColo
 
 NSColorPanelWrapper* nsColorPicker::sColorPanelWrapper = nullptr;
 
 nsColorPicker::~nsColorPicker()
 {
 }
 
 NS_IMETHODIMP
-nsColorPicker::Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
+nsColorPicker::Init(nsPIDOMWindowOuter* aParent, const nsAString& aTitle,
                     const nsAString& aInitialColor)
 {
   MOZ_ASSERT(NS_IsMainThread(),
       "Color pickers can only be opened from main thread currently");
   mTitle = aTitle;
   mColor = aInitialColor;
 
   if (sColorPanelWrapper) {
--- a/widget/gtk/TaskbarProgress.cpp
+++ b/widget/gtk/TaskbarProgress.cpp
@@ -78,17 +78,17 @@ TaskbarProgress::SetProgressState(nsTask
 
   mPrimaryWindow->SetProgress(progress);
 #endif
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TaskbarProgress::SetPrimaryWindow(mozIDOMWindowProxy* aWindow)
+TaskbarProgress::SetPrimaryWindow(nsPIDOMWindowOuter* aWindow)
 {
   NS_ENSURE_TRUE(aWindow != nullptr, NS_ERROR_ILLEGAL_VALUE);
 
   auto* parent = nsPIDOMWindowOuter::From(aWindow);
   RefPtr<nsIWidget> widget = mozilla::widget::WidgetUtils::DOMWindowToWidget(parent);
 
   // Only nsWindows have a native window, HeadlessWidgets do not.  Stop here if the
   // window does not have one.
--- a/widget/gtk/nsApplicationChooser.cpp
+++ b/widget/gtk/nsApplicationChooser.cpp
@@ -24,17 +24,17 @@ nsApplicationChooser::nsApplicationChoos
 {
 }
 
 nsApplicationChooser::~nsApplicationChooser()
 {
 }
 
 NS_IMETHODIMP
-nsApplicationChooser::Init(mozIDOMWindowProxy* aParent,
+nsApplicationChooser::Init(nsPIDOMWindowOuter* aParent,
                            const nsACString& aTitle)
 {
   NS_ENSURE_TRUE(aParent, NS_ERROR_FAILURE);
   auto* parent = nsPIDOMWindowOuter::From(aParent);
   mParentWidget = widget::WidgetUtils::DOMWindowToWidget(parent);
   mWindowTitle.Assign(aTitle);
   return NS_OK;
 }
--- a/widget/gtk/nsColorPicker.cpp
+++ b/widget/gtk/nsColorPicker.cpp
@@ -53,17 +53,17 @@ GdkColor nsColorPicker::convertToGdkColo
 
 GtkColorSelection* nsColorPicker::WidgetGetColorSelection(GtkWidget* widget)
 {
   return GTK_COLOR_SELECTION(gtk_color_selection_dialog_get_color_selection(
                              GTK_COLOR_SELECTION_DIALOG(widget)));
 }
 #endif
 
-NS_IMETHODIMP nsColorPicker::Init(mozIDOMWindowProxy *aParent,
+NS_IMETHODIMP nsColorPicker::Init(nsPIDOMWindowOuter *aParent,
                                   const nsAString& title,
                                   const nsAString& initialColor)
 {
   auto* parent = nsPIDOMWindowOuter::From(aParent);
   mParentWidget = mozilla::widget::WidgetUtils::DOMWindowToWidget(parent);
   mTitle = title;
   mInitialColor = initialColor;
 
--- a/widget/nsBaseFilePicker.cpp
+++ b/widget/nsBaseFilePicker.cpp
@@ -159,17 +159,17 @@ nsBaseFilePicker::nsBaseFilePicker()
 
 }
 
 nsBaseFilePicker::~nsBaseFilePicker()
 {
 
 }
 
-NS_IMETHODIMP nsBaseFilePicker::Init(mozIDOMWindowProxy* aParent,
+NS_IMETHODIMP nsBaseFilePicker::Init(nsPIDOMWindowOuter* aParent,
                                      const nsAString& aTitle,
                                      int16_t aMode)
 {
   MOZ_ASSERT(aParent, "Null parent passed to filepicker, no file "
                   "picker for you!");
 
   mParent = nsPIDOMWindowOuter::From(aParent);
 
--- a/widget/nsBaseFilePicker.h
+++ b/widget/nsBaseFilePicker.h
@@ -19,17 +19,17 @@ class nsIWidget;
 
 class nsBaseFilePicker : public nsIFilePicker
 {
   class AsyncShowFilePicker;
 public:
   nsBaseFilePicker(); 
   virtual ~nsBaseFilePicker();
 
-  NS_IMETHOD Init(mozIDOMWindowProxy* aParent,
+  NS_IMETHOD Init(nsPIDOMWindowOuter* aParent,
                   const nsAString& aTitle,
                   int16_t aMode) override;
 
   NS_IMETHOD Open(nsIFilePickerShownCallback *aCallback) override;
   NS_IMETHOD AppendFilters(int32_t filterMask) override;
   NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex) override;
   NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
   NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles) override;
--- a/widget/nsColorPickerProxy.cpp
+++ b/widget/nsColorPickerProxy.cpp
@@ -8,17 +8,17 @@
 
 #include "mozilla/dom/TabChild.h"
 
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(nsColorPickerProxy, nsIColorPicker)
 
 NS_IMETHODIMP
-nsColorPickerProxy::Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
+nsColorPickerProxy::Init(nsPIDOMWindowOuter* aParent, const nsAString& aTitle,
                          const nsAString& aInitialColor)
 {
   TabChild* tabChild = TabChild::GetFrom(aParent);
   if (!tabChild) {
     return NS_ERROR_FAILURE;
   }
 
   tabChild->SendPColorPickerConstructor(this,
--- a/widget/nsFilePickerProxy.cpp
+++ b/widget/nsFilePickerProxy.cpp
@@ -22,17 +22,17 @@ nsFilePickerProxy::nsFilePickerProxy()
 {
 }
 
 nsFilePickerProxy::~nsFilePickerProxy()
 {
 }
 
 NS_IMETHODIMP
-nsFilePickerProxy::Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
+nsFilePickerProxy::Init(nsPIDOMWindowOuter* aParent, const nsAString& aTitle,
                         int16_t aMode)
 {
   TabChild* tabChild = TabChild::GetFrom(aParent);
   if (!tabChild) {
     return NS_ERROR_FAILURE;
   }
 
   mParent = nsPIDOMWindowOuter::From(aParent);
--- a/widget/nsFilePickerProxy.h
+++ b/widget/nsFilePickerProxy.h
@@ -29,17 +29,17 @@ class nsFilePickerProxy : public nsBaseF
                           public mozilla::dom::PFilePickerChild
 {
 public:
     nsFilePickerProxy();
 
     NS_DECL_ISUPPORTS
 
     // nsIFilePicker (less what's in nsBaseFilePicker)
-    NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle, int16_t aMode) override;
+    NS_IMETHOD Init(nsPIDOMWindowOuter* aParent, const nsAString& aTitle, int16_t aMode) override;
     NS_IMETHOD AppendFilter(const nsAString& aTitle, const nsAString& aFilter) override;
     NS_IMETHOD GetDefaultString(nsAString& aDefaultString) override;
     NS_IMETHOD SetDefaultString(const nsAString& aDefaultString) override;
     NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension) override;
     NS_IMETHOD SetDefaultExtension(const nsAString& aDefaultExtension) override;
     NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override;
     NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
     NS_IMETHOD GetFile(nsIFile** aFile) override;
--- a/widget/nsIApplicationChooser.idl
+++ b/widget/nsIApplicationChooser.idl
@@ -2,17 +2,17 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsIMIMEInfo.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 [scriptable, function, uuid(8144404d-e6c7-4861-bcca-47de912ee811)]
 interface nsIApplicationChooserFinishedCallback : nsISupports
 {
   void done(in nsIHandlerApp handlerApp);
 };
 
 [scriptable, uuid(f7a149da-612a-46ba-8a2f-54786fc28791)]
@@ -22,17 +22,17 @@ interface nsIApplicationChooser : nsISup
   * Initialize the application chooser picker widget.  The application chooser
   * is not valid until this method is called.
   *
   * @param      parent   nsIDOMWindow parent.  This dialog will be dependent
   *                      on this parent. parent must be non-null.
   * @param      title    The title for the file widget
   *
   */
-  void init(in mozIDOMWindowProxy parent, in ACString title);
+  void init(in WindowProxy parent, in ACString title);
 
   /**
    * Open application chooser dialog.
    *
    * @param    contentType   content type of file to open
    * @param    applicationChooserFinishedCallback  callback fuction to run when dialog is closed
    */
   void open(in ACString contentType, in nsIApplicationChooserFinishedCallback applicationChooserFinishedCallback);
--- a/widget/nsIColorPicker.idl
+++ b/widget/nsIColorPicker.idl
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /**
  * nsIColorPicker is representing colors as strings because the internal
  * representation will depend on the underlying backend.
  * The format of the colors taken in input and returned will always follow the
  * format of the <input type='color'> value as described in the HTML
  * specifications.
  */
@@ -57,16 +57,16 @@ interface nsIColorPicker : nsISupports
   *
   * @param      parent       nsIDOMWindow parent. This dialog will be dependent
   *                          on this parent. parent must be non-null.
   * @param      title        The title for the color picker widget.
   * @param      initialColor The color to show when the widget is opened. The
   *                          parameter has to follow the format specified on top
   *                          of this file.
   */
-  void init(in mozIDOMWindowProxy parent, in AString title, in AString initialColor);
+  void init(in WindowProxy parent, in AString title, in AString initialColor);
 
  /**
   * Opens the color dialog asynchrounously.
   * The results are provided via the callback object.
   */
   void open(in nsIColorPickerShownCallback aColorPickerShownCallback);
 };
--- a/widget/nsIFilePicker.idl
+++ b/widget/nsIFilePicker.idl
@@ -3,17 +3,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIFile;
 interface nsIURI;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsISimpleEnumerator;
 
 [scriptable, function, uuid(0d79adad-b244-49A5-9997-2a8cad93fc44)]
 interface nsIFilePickerShownCallback : nsISupports
 {
  /**
   * Callback which is called when a filepicker is shown and a result
   * is returned.
@@ -57,23 +57,23 @@ interface nsIFilePicker : nsISupports
                                                 // *.mpg; *.ogm; *.ogv; *.ogx;
                                                 // *.rm; *.rmvb; *.smil; *.webm;
                                                 // *.wmv; *.xvid
 
  /**
   * Initialize the file picker widget.  The file picker is not valid until this
   * method is called.
   *
-  * @param      parent   mozIDOMWindow parent.  This dialog will be dependent
+  * @param      parent   Window parent.  This dialog will be dependent
   *                      on this parent. parent must be non-null.
   * @param      title    The title for the file widget
   * @param      mode     load, save, or get folder
   *
   */
-  void init(in mozIDOMWindowProxy parent, in AString title, in short mode);
+  void init(in WindowProxy parent, in AString title, in short mode);
 
  /**
   * Append to the  filter list with things from the predefined list
   *
   * @param      filters  mask of filters i.e. (filterAll | filterHTML)
   *
   */
   void appendFilters(in long filterMask);
--- a/widget/nsIGtkTaskbarProgress.idl
+++ b/widget/nsIGtkTaskbarProgress.idl
@@ -1,22 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsITaskbarProgress.idl"
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 /**
  * Allow the TaskbarProgress instance to set a new target window.
  */
 
 [scriptable, uuid(39f6fc5a-2386-4bc6-941c-d7479253bc3f)]
 interface nsIGtkTaskbarProgress : nsITaskbarProgress
 {
   /**
    * Sets the window that is considered primary for purposes of
    * setting the XApp progress property.
    */
 
-  void setPrimaryWindow(in mozIDOMWindowProxy aWindow);
+  void setPrimaryWindow(in WindowProxy aWindow);
 };
--- a/widget/nsIWinTaskbar.idl
+++ b/widget/nsIWinTaskbar.idl
@@ -10,17 +10,17 @@
 
 interface nsIDocShell;
 interface nsITaskbarTabPreview;
 interface nsITaskbarWindowPreview;
 interface nsITaskbarPreviewController;
 interface nsITaskbarProgress;
 interface nsITaskbarOverlayIconController;
 interface nsIJumpListBuilder;
-interface mozIDOMWindow;
+webidl Window;
 
 /*
  * nsIWinTaskbar
  *
  * This interface represents a service which exposes the APIs provided by the
  * Windows taskbar to applications.
  *
  * Starting in Windows 7, applications gain some control over their appearance
@@ -144,29 +144,29 @@ interface nsIWinTaskbar : nsISupports
    * Note, when a window changes taskbar window stacks, it is placed at the
    * bottom of the new stack.
    *
    * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
    * associated with a widget.
    * @throw NS_ERROR_FAILURE if the property on the window could not be set.
    * @throw NS_ERROR_UNEXPECTED for general failures.
    */
-  void setGroupIdForWindow(in mozIDOMWindow aParent, in AString aIdentifier);
+  void setGroupIdForWindow(in Window aParent, in AString aIdentifier);
 
   /**
    * Notify the taskbar that a window is about to enter full screen mode.
    *
    * A Windows autohide taskbar will not behave correctly in all cases if
    * it is not notified when full screen operations start and end.
    *
    * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
    * @throw NS_ERROR_UNEXPECTED for general failures.
    * @throw NS_ERROR_NOT_AVAILABLE if the taskbar cannot be obtained.
    */
-  void prepareFullScreen(in mozIDOMWindow aWindow, in boolean aFullScreen);
+  void prepareFullScreen(in Window aWindow, in boolean aFullScreen);
 
   /**
    * Notify the taskbar that a window identified by its HWND is about to enter
    * full screen mode.
    *
    * A Windows autohide taskbar will not behave correctly in all cases if
    * it is not notified when full screen operations start and end.
    *
--- a/widget/windows/WinTaskbar.cpp
+++ b/widget/windows/WinTaskbar.cpp
@@ -46,28 +46,28 @@ GetHWNDFromDocShell(nsIDocShell *aShell)
 
   nsCOMPtr<nsIWidget> widget;
   baseWindow->GetMainWidget(getter_AddRefs(widget));
 
   return widget ? (HWND)widget->GetNativeData(NS_NATIVE_WINDOW) : nullptr;
 }
 
 HWND
-GetHWNDFromDOMWindow(mozIDOMWindow *dw) {
+GetHWNDFromDOMWindow(nsPIDOMWindowInner *dw) {
   nsCOMPtr<nsIWidget> widget;
 
   if (!dw)
     return nullptr;
 
   nsCOMPtr<nsPIDOMWindowInner> window = nsPIDOMWindowInner::From(dw);
   return GetHWNDFromDocShell(window->GetDocShell());
 }
 
 nsresult
-SetWindowAppUserModelProp(mozIDOMWindow *aParent,
+SetWindowAppUserModelProp(nsPIDOMWindowInner *aParent,
                           const nsString & aIdentifier) {
   NS_ENSURE_ARG_POINTER(aParent);
 
   if (aIdentifier.IsEmpty())
     return NS_ERROR_INVALID_ARG;
 
   HWND toplevelHWND = ::GetAncestor(GetHWNDFromDOMWindow(aParent), GA_ROOT);
 
@@ -405,23 +405,23 @@ WinTaskbar::CreateJumpListBuilder(nsIJum
     return NS_ERROR_UNEXPECTED;
 
   NS_IF_ADDREF(*aJumpListBuilder = builder);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-WinTaskbar::SetGroupIdForWindow(mozIDOMWindow *aParent,
+WinTaskbar::SetGroupIdForWindow(nsPIDOMWindowInner *aParent,
                                 const nsAString & aIdentifier) {
   return SetWindowAppUserModelProp(aParent, nsString(aIdentifier));
 }
 
 NS_IMETHODIMP
-WinTaskbar::PrepareFullScreen(mozIDOMWindow *aWindow, bool aFullScreen) {
+WinTaskbar::PrepareFullScreen(nsPIDOMWindowInner *aWindow, bool aFullScreen) {
   NS_ENSURE_ARG_POINTER(aWindow);
 
   HWND toplevelHWND = ::GetAncestor(GetHWNDFromDOMWindow(aWindow), GA_ROOT);
   if (!toplevelHWND)
     return NS_ERROR_INVALID_ARG;
 
   return PrepareFullScreenHWND(toplevelHWND, aFullScreen);
 }
--- a/widget/windows/nsColorPicker.cpp
+++ b/widget/windows/nsColorPicker.cpp
@@ -187,17 +187,17 @@ nsColorPicker::nsColorPicker()
 
 nsColorPicker::~nsColorPicker()
 {
 }
 
 NS_IMPL_ISUPPORTS(nsColorPicker, nsIColorPicker)
 
 NS_IMETHODIMP
-nsColorPicker::Init(mozIDOMWindowProxy* parent,
+nsColorPicker::Init(nsPIDOMWindowOuter* parent,
                     const nsAString& title,
                     const nsAString& aInitialColor)
 {
   MOZ_ASSERT(parent,
       "Null parent passed to colorpicker, no color picker for you!");
   mParentWidget =  WidgetUtils::DOMWindowToWidget(nsPIDOMWindowOuter::From(parent));
   mInitialColor = ColorStringToRGB(aInitialColor);
   return NS_OK;
--- a/widget/windows/nsColorPicker.h
+++ b/widget/windows/nsColorPicker.h
@@ -42,17 +42,17 @@ class nsColorPicker :
 {
   virtual ~nsColorPicker();
 
 public:
   nsColorPicker();
 
   NS_DECL_ISUPPORTS
 
-  NS_IMETHOD Init(mozIDOMWindowProxy* parent, const nsAString& title,
+  NS_IMETHOD Init(nsPIDOMWindowOuter* parent, const nsAString& title,
                   const nsAString& aInitialColor);
   NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback) override;
 
 private:
   COLORREF mInitialColor;
   nsCOMPtr<nsIWidget> mParentWidget;
 };
 
--- a/widget/windows/nsFilePicker.cpp
+++ b/widget/windows/nsFilePicker.cpp
@@ -189,17 +189,17 @@ nsFilePicker::~nsFilePicker()
     free(mLastUsedUnicodeDirectory);
     mLastUsedUnicodeDirectory = nullptr;
   }
   CoUninitialize();
 }
 
 NS_IMPL_ISUPPORTS(nsFilePicker, nsIFilePicker)
 
-NS_IMETHODIMP nsFilePicker::Init(mozIDOMWindowProxy *aParent, const nsAString& aTitle, int16_t aMode)
+NS_IMETHODIMP nsFilePicker::Init(nsPIDOMWindowOuter *aParent, const nsAString& aTitle, int16_t aMode)
 {
   nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryInterface(aParent);
   nsIDocShell* docShell = window ? window->GetDocShell() : nullptr;  
   mLoadContext = do_QueryInterface(docShell);
   
   return nsBaseFilePicker::Init(aParent, aTitle, aMode);
 }
 
--- a/widget/windows/nsFilePicker.h
+++ b/widget/windows/nsFilePicker.h
@@ -44,17 +44,17 @@ protected:
 class nsFilePicker :
   public IFileDialogEvents,
   public nsBaseWinFilePicker
 {
   virtual ~nsFilePicker();
 public:
   nsFilePicker();
 
-  NS_IMETHOD Init(mozIDOMWindowProxy *aParent, const nsAString& aTitle, int16_t aMode) override;
+  NS_IMETHOD Init(nsPIDOMWindowOuter *aParent, const nsAString& aTitle, int16_t aMode) override;
 
   NS_DECL_ISUPPORTS
 
   // IUnknown's QueryInterface
   STDMETHODIMP QueryInterface(REFIID refiid, void** ppvResult);
 
   // nsIFilePicker (less what's in nsBaseFilePicker and nsBaseWinFilePicker)
   NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex) override;
--- a/widget/windows/nsPrintDialogWin.cpp
+++ b/widget/windows/nsPrintDialogWin.cpp
@@ -100,33 +100,33 @@ nsPrintDialogServiceWin::ShowPageSetup(n
     block->GetInt(0, &status);
     return status == 0 ? NS_ERROR_ABORT : NS_OK;
   }
 
   return rv;
 }
 
 nsresult
-nsPrintDialogServiceWin::DoDialog(mozIDOMWindowProxy* aParent,
+nsPrintDialogServiceWin::DoDialog(nsPIDOMWindowOuter* aParent,
                                   nsIDialogParamBlock* aParamBlock,
                                   nsIPrintSettings* aPS,
                                   const char* aChromeURL)
 {
   NS_ENSURE_ARG(aParamBlock);
   NS_ENSURE_ARG(aPS);
   NS_ENSURE_ARG(aChromeURL);
 
   if (!mWatcher)
     return NS_ERROR_FAILURE;
 
   // get a parent, if at all possible
   // (though we'd rather this didn't fail, it's OK if it does. so there's
   // no failure or null check.)
   // retain ownership for method lifetime
-  nsCOMPtr<mozIDOMWindowProxy> activeParent;
+  nsCOMPtr<nsPIDOMWindowOuter> activeParent;
   if (!aParent) {
     mWatcher->GetActiveWindow(getter_AddRefs(activeParent));
     aParent = activeParent;
   }
 
   // create a nsIMutableArray of the parameters
   // being passed to the window
   nsCOMPtr<nsIMutableArray> array = nsArray::Create();
@@ -134,35 +134,35 @@ nsPrintDialogServiceWin::DoDialog(mozIDO
   nsCOMPtr<nsISupports> psSupports(do_QueryInterface(aPS));
   NS_ASSERTION(psSupports, "PrintSettings must be a supports");
   array->AppendElement(psSupports);
 
   nsCOMPtr<nsISupports> blkSupps(do_QueryInterface(aParamBlock));
   NS_ASSERTION(blkSupps, "IOBlk must be a supports");
   array->AppendElement(blkSupps);
 
-  nsCOMPtr<mozIDOMWindowProxy> dialog;
+  nsCOMPtr<nsPIDOMWindowOuter> dialog;
   nsresult rv = mWatcher->OpenWindow(aParent,
                                      aChromeURL,
                                      "_blank",
                                      "centerscreen,chrome,modal,titlebar",
                                      array,
                                      getter_AddRefs(dialog));
 
   return rv;
 }
 
 HWND
-nsPrintDialogServiceWin::GetHWNDForDOMWindow(mozIDOMWindowProxy* aWindow)
+nsPrintDialogServiceWin::GetHWNDForDOMWindow(nsPIDOMWindowOuter* aWindow)
 {
   nsCOMPtr<nsIWebBrowserChrome> chrome;
 
   // We might be embedded so check this path first
   if (mWatcher) {
-    nsCOMPtr<mozIDOMWindowProxy> fosterParent;
+    nsCOMPtr<nsPIDOMWindowOuter> fosterParent;
     // it will be a dependent window. try to find a foster parent.
     if (!aWindow) {
       mWatcher->GetActiveWindow(getter_AddRefs(fosterParent));
       aWindow = fosterParent;
     }
     mWatcher->GetChromeForWindow(aWindow, getter_AddRefs(chrome));
   }
 
--- a/widget/windows/nsPrintDialogWin.h
+++ b/widget/windows/nsPrintDialogWin.h
@@ -26,19 +26,19 @@ public:
   NS_IMETHOD Init() override;
   NS_IMETHOD Show(nsPIDOMWindowOuter* aParent,
                   nsIPrintSettings* aSettings,
                   nsIWebBrowserPrint* aWebBrowserPrint) override;
   NS_IMETHOD ShowPageSetup(nsPIDOMWindowOuter* aParent,
                            nsIPrintSettings* aSettings) override;
 
 private:
-  nsresult DoDialog(mozIDOMWindowProxy* aParent,
+  nsresult DoDialog(nsPIDOMWindowOuter* aParent,
                     nsIDialogParamBlock* aParamBlock,
                     nsIPrintSettings* aPS,
                     const char* aChromeURL);
 
-  HWND GetHWNDForDOMWindow(mozIDOMWindowProxy* aWindow);
+  HWND GetHWNDForDOMWindow(nsPIDOMWindowOuter* aWindow);
 
   nsCOMPtr<nsIWindowWatcher> mWatcher;
 };
 
 #endif
--- a/xpcom/base/nsIMemoryReporter.idl
+++ b/xpcom/base/nsIMemoryReporter.idl
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 %{C++
 #include <stdio.h>
 %}
 
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIRunnable;
 interface nsISimpleEnumerator;
 [ptr] native FILE(FILE);
 
 /*
  * Memory reporters measure Firefox's memory usage.  They are primarily used to
  * generate the about:memory page.  You should read
  * https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Memory_reporting
@@ -438,17 +438,17 @@ interface nsIMemoryReporterManager : nsI
    * true number, due to imperfect memory reporter coverage (corresponding to
    * about:memory's "heap-unclassified"), and due to some memory shared between
    * tabs not being counted.
    *
    * The time taken for the measurement (split into JS and non-JS parts) is
    * also returned.
    */
   [must_use]
-  void sizeOfTab(in mozIDOMWindowProxy window,
+  void sizeOfTab(in WindowProxy window,
                  out int64_t jsObjectsSize, out int64_t jsStringsSize,
                  out int64_t jsOtherSize, out int64_t domSize,
                  out int64_t styleSize, out int64_t otherSize,
                  out int64_t totalSize,
                  out double jsMilliseconds, out double nonJSMilliseconds);
 };
 
 %{C++
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -2643,17 +2643,17 @@ nsMemoryReporterManager::MinimizeMemoryU
 {
   RefPtr<MinimizeMemoryUsageRunnable> runnable =
     new MinimizeMemoryUsageRunnable(aCallback);
 
   return NS_DispatchToMainThread(runnable);
 }
 
 NS_IMETHODIMP
-nsMemoryReporterManager::SizeOfTab(mozIDOMWindowProxy* aTopWindow,
+nsMemoryReporterManager::SizeOfTab(nsPIDOMWindowOuter* aTopWindow,
                                    int64_t* aJSObjectsSize,
                                    int64_t* aJSStringsSize,
                                    int64_t* aJSOtherSize,
                                    int64_t* aDomSize,
                                    int64_t* aStyleSize,
                                    int64_t* aOtherSize,
                                    int64_t* aTotalSize,
                                    double*  aJSMilliseconds,
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -46,17 +46,16 @@
 #include "SpecialSystemDirectory.h"
 
 #include "nsTraceRefcnt.h"
 #include "nsXPCOMCIDInternal.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
 #include "nsIWindowMediator.h"
-#include "mozIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWidget.h"
 #include "mozilla/WidgetUtils.h"
 
 using namespace mozilla;
 
 #define CHECK_mWorkingPath()                    \
     do {                                        \
@@ -82,17 +81,17 @@ GetMostRecentNavigatorHWND()
 {
   nsresult rv;
   nsCOMPtr<nsIWindowMediator> winMediator(
       do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv));
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> navWin;
+  nsCOMPtr<nsPIDOMWindowOuter> navWin;
   rv = winMediator->GetMostRecentWindow(u"navigator:browser",
                                         getter_AddRefs(navWin));
   if (NS_FAILED(rv) || !navWin) {
     return nullptr;
   }
 
   nsPIDOMWindowOuter* win = nsPIDOMWindowOuter::From(navWin);
   nsCOMPtr<nsIWidget> widget = widget::WidgetUtils::DOMWindowToWidget(win);
--- a/xpfe/appshell/nsAppShellService.cpp
+++ b/xpfe/appshell/nsAppShellService.cpp
@@ -183,17 +183,17 @@ nsAppShellService::DestroyHiddenWindow()
  */
 NS_IMETHODIMP
 nsAppShellService::CreateTopLevelWindow(nsIXULWindow *aParent,
                                         nsIURI *aUrl,
                                         uint32_t aChromeMask,
                                         int32_t aInitialWidth,
                                         int32_t aInitialHeight,
                                         nsITabParent *aOpeningTab,
-                                        mozIDOMWindowProxy *aOpenerWindow,
+                                        nsPIDOMWindowOuter *aOpenerWindow,
                                         nsIXULWindow **aResult)
 
 {
   nsresult rv;
 
   StartupTimeline::RecordOnce(StartupTimeline::CREATE_TOP_LEVEL_WINDOW);
 
   RefPtr<nsWebShellWindow> newWindow;
@@ -631,17 +631,17 @@ CheckForFullscreenWindow()
 nsresult
 nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
                                        nsIURI *aUrl,
                                        uint32_t aChromeMask,
                                        int32_t aInitialWidth,
                                        int32_t aInitialHeight,
                                        bool aIsHiddenWindow,
                                        nsITabParent *aOpeningTab,
-                                       mozIDOMWindowProxy *aOpenerWindow,
+                                       nsPIDOMWindowOuter *aOpenerWindow,
                                        nsWebShellWindow **aResult)
 {
   *aResult = nullptr;
   NS_ENSURE_STATE(!mXPCOMWillShutDown);
 
   nsCOMPtr<nsIXULWindow> parent;
   if (aChromeMask & nsIWebBrowserChrome::CHROME_DEPENDENT)
     parent = aParent;
@@ -748,32 +748,32 @@ nsAppShellService::JustCreateTopWindow(n
   if (aChromeMask & nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW) {
     // Caller requested a private window
     isPrivateBrowsingWindow = true;
   }
   if (aChromeMask & nsIWebBrowserChrome::CHROME_REMOTE_WINDOW) {
     isUsingRemoteTabs = true;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> domWin = do_GetInterface(aParent);
+  nsCOMPtr<nsPIDOMWindowOuter> domWin = do_GetInterface(aParent);
   nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(domWin);
   nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(webNav);
 
   if (!isPrivateBrowsingWindow && parentContext) {
     // Ensure that we propagate any existing private browsing status
     // from the parent, even if it will not actually be used
     // as a parent value.
     isPrivateBrowsingWindow = parentContext->UsePrivateBrowsing();
   }
 
   if (parentContext) {
     isUsingRemoteTabs = parentContext->UseRemoteTabs();
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> newDomWin =
+  nsCOMPtr<nsPIDOMWindowOuter> newDomWin =
       do_GetInterface(NS_ISUPPORTS_CAST(nsIBaseWindow*, window));
   nsCOMPtr<nsIWebNavigation> newWebNav = do_GetInterface(newDomWin);
   nsCOMPtr<nsILoadContext> thisContext = do_GetInterface(newWebNav);
   if (thisContext) {
     thisContext->SetPrivateBrowsing(isPrivateBrowsingWindow);
     thisContext->SetRemoteTabs(isUsingRemoteTabs);
   }
 
@@ -793,17 +793,17 @@ nsAppShellService::GetHiddenWindow(nsIXU
   NS_ENSURE_ARG_POINTER(aWindow);
 
   *aWindow = mHiddenWindow;
   NS_IF_ADDREF(*aWindow);
   return *aWindow ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsAppShellService::GetHiddenDOMWindow(mozIDOMWindowProxy **aWindow)
+nsAppShellService::GetHiddenDOMWindow(nsPIDOMWindowOuter **aWindow)
 {
   nsresult rv;
   nsCOMPtr<nsIDocShell> docShell;
   NS_ENSURE_TRUE(mHiddenWindow, NS_ERROR_FAILURE);
 
   rv = mHiddenWindow->GetDocShell(getter_AddRefs(docShell));
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
@@ -821,17 +821,17 @@ nsAppShellService::GetHiddenPrivateWindo
   EnsurePrivateHiddenWindow();
 
   *aWindow = mHiddenPrivateWindow;
   NS_IF_ADDREF(*aWindow);
   return *aWindow ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsAppShellService::GetHiddenPrivateDOMWindow(mozIDOMWindowProxy **aWindow)
+nsAppShellService::GetHiddenPrivateDOMWindow(nsPIDOMWindowOuter **aWindow)
 {
   EnsurePrivateHiddenWindow();
 
   nsresult rv;
   nsCOMPtr<nsIDocShell> docShell;
   NS_ENSURE_TRUE(mHiddenPrivateWindow, NS_ERROR_FAILURE);
 
   rv = mHiddenPrivateWindow->GetDocShell(getter_AddRefs(docShell));
--- a/xpfe/appshell/nsAppShellService.h
+++ b/xpfe/appshell/nsAppShellService.h
@@ -37,17 +37,17 @@ protected:
   void EnsurePrivateHiddenWindow();
 
   nsresult JustCreateTopWindow(nsIXULWindow *aParent,
                                nsIURI *aUrl,
                                uint32_t aChromeMask,
                                int32_t aInitialWidth, int32_t aInitialHeight,
                                bool aIsHiddenWindow,
                                nsITabParent *aOpeningTab,
-                               mozIDOMWindowProxy *aOpenerWindow,
+                               nsPIDOMWindowOuter *aOpenerWindow,
                                nsWebShellWindow **aResult);
   uint32_t CalculateWindowZLevel(nsIXULWindow *aParent, uint32_t aChromeMask);
 
   RefPtr<nsWebShellWindow>  mHiddenWindow;
   RefPtr<nsWebShellWindow>  mHiddenPrivateWindow;
   bool                        mXPCOMWillShutDown;
   bool                        mXPCOMShuttingDown;
   uint16_t                    mModalWindowCount;
--- a/xpfe/appshell/nsContentTreeOwner.cpp
+++ b/xpfe/appshell/nsContentTreeOwner.cpp
@@ -786,28 +786,28 @@ NS_IMETHODIMP nsContentTreeOwner::SetTit
 
   return mXULWindow->SetTitle(title);
 }
 
 //*****************************************************************************
 // nsContentTreeOwner: nsIWindowProvider
 //*****************************************************************************
 NS_IMETHODIMP
-nsContentTreeOwner::ProvideWindow(mozIDOMWindowProxy* aParent,
+nsContentTreeOwner::ProvideWindow(nsPIDOMWindowOuter* aParent,
                                   uint32_t aChromeFlags,
                                   bool aCalledFromJS,
                                   bool aPositionSpecified,
                                   bool aSizeSpecified,
                                   nsIURI* aURI,
                                   const nsAString& aName,
                                   const nsACString& aFeatures,
                                   bool aForceNoOpener,
                                   nsIDocShellLoadInfo* aLoadInfo,
                                   bool* aWindowIsNew,
-                                  mozIDOMWindowProxy** aReturn)
+                                  nsPIDOMWindowOuter** aReturn)
 {
   NS_ENSURE_ARG_POINTER(aParent);
 
   auto* parent = nsPIDOMWindowOuter::From(aParent);
 
   *aReturn = nullptr;
 
   if (!mXULWindow) {
@@ -868,17 +868,17 @@ nsContentTreeOwner::ProvideWindow(mozIDO
                                            aPositionSpecified, aSizeSpecified);
 
   if (openLocation != nsIBrowserDOMWindow::OPEN_NEWTAB &&
       openLocation != nsIBrowserDOMWindow::OPEN_CURRENTWINDOW) {
     // Just open a window normally
     return NS_OK;
   }
 
-  nsCOMPtr<mozIDOMWindowProxy> domWin;
+  nsCOMPtr<nsPIDOMWindowOuter> domWin;
   mXULWindow->GetWindowDOMWindow(getter_AddRefs(domWin));
   nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(domWin);
   if (!chromeWin) {
     // Really odd... but whatever
     NS_WARNING("nsXULWindow's DOMWindow is not a chrome window");
     return NS_OK;
   }
 
--- a/xpfe/appshell/nsIAppShellService.idl
+++ b/xpfe/appshell/nsIAppShellService.idl
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIXULWindow;
 interface nsIWindowlessBrowser;
 interface nsIURI;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 interface nsIAppShell;
 interface nsITabParent;
 
 [ptr] native JSContext(JSContext);
 
 %{C++
 #include "js/TypeDecls.h"
 %}
@@ -43,17 +43,17 @@ interface nsIAppShellService : nsISuppor
    */
   const long SIZE_TO_CONTENT = -1;
   nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent,
                                     in nsIURI aUrl, 
                                     in uint32_t aChromeMask,
                                     in long aInitialWidth,
                                     in long aInitialHeight,
                                     in nsITabParent aOpeningTab,
-                                    in mozIDOMWindowProxy aOpenerWindow);
+                                    in WindowProxy aOpenerWindow);
 
   /**
    * This is the constructor for creating an invisible DocShell.
    * It is used to simulate DOM windows without an actual physical
    * representation.
    * @param aIsChrome Set true if you want to use it for chrome content.
    */
   nsIWindowlessBrowser createWindowlessBrowser([optional] in bool aIsChrome);
@@ -82,17 +82,17 @@ interface nsIAppShellService : nsISuppor
   readonly attribute nsIXULWindow hiddenWindow;
 
   /**
    * Return the (singleton) application hidden window, automatically created
    * and maintained by this AppShellService.
    * @param aResult the hidden window.  Do not unhide hidden window.
    *                Do not taunt hidden window.
    */
-  readonly attribute mozIDOMWindowProxy hiddenDOMWindow;
+  readonly attribute WindowProxy hiddenDOMWindow;
 
   /**
    * Return the (singleton) application hidden private window, automatically
    * created and maintained by this AppShellService.  This window is created
    * in private browsing mode.
    * @param aResult the hidden private window.  Do not unhide hidden window.
    *                Do not taunt hidden window.
    */
@@ -100,17 +100,17 @@ interface nsIAppShellService : nsISuppor
 
   /**
    * Return the (singleton) application hidden private window, automatically
    * created and maintained by this AppShellService.  This window is created
    * in private browsing mode.
    * @param aResult the hidden private window.  Do not unhide hidden window.
    *                Do not taunt hidden window.
    */
-  readonly attribute mozIDOMWindowProxy hiddenPrivateDOMWindow;
+  readonly attribute WindowProxy hiddenPrivateDOMWindow;
 
   /**
    * Return true if the application hidden window was provided by the
    * application. If it wasn't, the default hidden window was used. This will
    * usually be false on all non-mac platforms.
    */
   readonly attribute boolean applicationProvidedHiddenWindow;
 
--- a/xpfe/appshell/nsIWindowMediator.idl
+++ b/xpfe/appshell/nsIWindowMediator.idl
@@ -10,18 +10,18 @@
 #define NS_WINDOWMEDIATOR_CID \
 { 0x79a2b7cc, 0xf05b, 0x4605, \
   { 0xbf, 0xa0, 0xfa, 0xc5, 0x4f, 0x27, 0xee, 0xc8 } }
 
 #define NS_WINDOWMEDIATOR_CONTRACTID \
   "@mozilla.org/appshell/window-mediator;1"
 %}
 
-interface mozIDOMWindow;
-interface mozIDOMWindowProxy;
+webidl Window;
+webidl WindowProxy;
 interface nsIXULWindow;
 interface nsIWidget;
 interface nsIWindowMediatorListener;
 
 [scriptable, uuid(df0da056-357d-427f-bafd-e6cbf19c9381)]
 interface nsIWindowMediator: nsISupports
 {
   /** Return an enumerator which iterates over all windows of type aWindowType
@@ -65,35 +65,35 @@ interface nsIWindowMediator: nsISupports
   /** This is a shortcut for simply fetching the first window in
     * front to back order.
     * @param  aWindowType return the topmost window of this type.
     *                     ("type" is the |windowtype| attribute of
     *                     the XML <window> element.)
     *                     If null, return the topmost window of any type.
     * @return the topmost window
     */
-  mozIDOMWindowProxy getMostRecentWindow(in wstring aWindowType);
+  WindowProxy getMostRecentWindow(in wstring aWindowType);
 
   /**
    * Same as getMostRecentWindow, but ignores private browsing
    * windows.
    */
-  mozIDOMWindowProxy getMostRecentNonPBWindow(in wstring aWindowType);
+  WindowProxy getMostRecentNonPBWindow(in wstring aWindowType);
 
   /**
    * Return the outer window with the given ID, if any.  Can return null.
    */
-  mozIDOMWindowProxy getOuterWindowWithId(in unsigned long long aOuterWindowID);
+  WindowProxy getOuterWindowWithId(in unsigned long long aOuterWindowID);
 
   /**
     * Return the inner window with the given current window ID, if any.
     * Can return null if no inner window with the ID exists or if it's not
     * a current inner anymore.
     */
-  mozIDOMWindow getCurrentInnerWindowWithId(in unsigned long long aInnerWindowID);
+  Window getCurrentInnerWindowWithId(in unsigned long long aInnerWindowID);
 
   /** Add the window to the list of known windows. Listeners (see
     * addListener) will be notified through their onOpenWindow method.
     * @param aWindow the window to add
     */
   [noscript] void registerWindow(in nsIXULWindow aWindow);
 
   /** Remove the window from the list of known windows. Listeners (see
--- a/xpfe/appshell/nsIXULBrowserWindow.idl
+++ b/xpfe/appshell/nsIXULBrowserWindow.idl
@@ -10,17 +10,17 @@
 
 interface nsIBrowser;
 interface nsIRequest;
 interface nsIInputStream;
 interface nsIDocShell;
 interface nsIFrameLoaderOwner;
 interface nsITabParent;
 interface nsIPrincipal;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 webidl Element;
 
 /**
  * The nsIXULBrowserWindow supplies the methods that may be called from the
  * internals of the browser area to tell the containing xul window to update
  * its ui. 
  */
@@ -41,17 +41,17 @@ interface nsIXULBrowserWindow : nsISuppo
                                 in nsIDOMNode linkNode,
                                 in boolean isAppTab);
 
   /**
    * Find the initial browser of the window and set its remote attributes.
    * This can be used to ensure that there is a browser in a new window of the
    * correct type when it first spawns.
    */
-  void forceInitialBrowserNonRemote(in mozIDOMWindowProxy openerWindow);
+  void forceInitialBrowserNonRemote(in WindowProxy openerWindow);
 
   /**
    * Determines whether a load should continue.
    *
    * @param aDocShell
    *        The docshell performing the load.
    * @param aURI
    *        The URI being loaded.
--- a/xpfe/appshell/nsIXULWindow.idl
+++ b/xpfe/appshell/nsIXULWindow.idl
@@ -17,17 +17,17 @@
 #include "LiveResizeListener.h"
 #include "nsTArray.h"
 %}
 
 interface nsIDocShell;
 interface nsIDocShellTreeItem;
 interface nsIXULBrowserWindow;
 interface nsITabParent;
-interface mozIDOMWindowProxy;
+webidl WindowProxy;
 
 native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
 
 [builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
 interface nsIXULWindow : nsISupports
 {
   /**
    * The docshell owning the XUL for this window.
@@ -124,17 +124,17 @@ interface nsIXULWindow : nsISupports
    *                    Can be left null.
    * @param aOpener The window which is requesting that this new window be opened.
    * @param aNextTabParentId The integer ID of the next tab parent actor to use.
    *        0 means there is no next tab parent actor to use.
    * @return the newly minted window
    */
   nsIXULWindow createNewWindow(in int32_t aChromeFlags,
                                in nsITabParent aOpeningTab,
-                               in mozIDOMWindowProxy aOpener,
+                               in WindowProxy aOpener,
                                in unsigned long long aNextTabParentId);
 
   attribute nsIXULBrowserWindow XULBrowserWindow;
 
   /**
    * Back-door method to make sure some stuff is done when the document is
    * ready for layout, that would cause expensive computation otherwise later.
    *
--- a/xpfe/appshell/nsWebShellWindow.cpp
+++ b/xpfe/appshell/nsWebShellWindow.cpp
@@ -103,17 +103,17 @@ NS_INTERFACE_MAP_END_INHERITING(nsXULWin
 
 nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
                                       nsIXULWindow* aOpener,
                                       nsIURI* aUrl,
                                       int32_t aInitialWidth,
                                       int32_t aInitialHeight,
                                       bool aIsHiddenWindow,
                                       nsITabParent *aOpeningTab,
-                                      mozIDOMWindowProxy *aOpenerWindow,
+                                      nsPIDOMWindowOuter *aOpenerWindow,
                                       nsWidgetInitData& widgetInitData)
 {
   nsresult rv;
   nsCOMPtr<nsIWidget> parentWidget;
 
   mIsHiddenWindow = aIsHiddenWindow;
 
   int32_t initialX = 0, initialY = 0;
@@ -623,17 +623,17 @@ nsWebShellWindow::OnStateChange(nsIWebPr
       !(aStateFlags & nsIWebProgressListener::STATE_IS_NETWORK)) {
     return NS_OK;
   }
 
   if (mChromeLoaded)
     return NS_OK;
 
   // If this document notification is for a frame then ignore it...
-  nsCOMPtr<mozIDOMWindowProxy> eventWin;
+  nsCOMPtr<nsPIDOMWindowOuter> eventWin;
   aProgress->GetDOMWindow(getter_AddRefs(eventWin));
   auto* eventPWin = nsPIDOMWindowOuter::From(eventWin);
   if (eventPWin) {
     nsPIDOMWindowOuter *rootPWin = eventPWin->GetPrivateRoot();
     if (eventPWin != rootPWin)
       return NS_OK;
   }
 
--- a/xpfe/appshell/nsWebShellWindow.h
+++ b/xpfe/appshell/nsWebShellWindow.h
@@ -81,17 +81,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsWebShellWindow methods...
   nsresult Initialize(nsIXULWindow * aParent, nsIXULWindow * aOpener,
                       nsIURI* aUrl,
                       int32_t aInitialWidth, int32_t aInitialHeight,
                       bool aIsHiddenWindow,
                       nsITabParent *aOpeningTab,
-                      mozIDOMWindowProxy *aOpenerWIndow,
+                      nsPIDOMWindowOuter *aOpenerWIndow,
                       nsWidgetInitData& widgetInitData);
 
   nsresult Toolbar();
 
   // nsIWebProgressListener
   NS_DECL_NSIWEBPROGRESSLISTENER
 
   // nsIBaseWindow
--- a/xpfe/appshell/nsWindowMediator.cpp
+++ b/xpfe/appshell/nsWindowMediator.cpp
@@ -253,17 +253,17 @@ nsWindowMediator::RemoveEnumerator(nsApp
 {
   return mEnumeratorList.RemoveElement(inEnumerator);
 }
 
 // Returns the window of type inType ( if null return any window type ) which has the most recent
 // time stamp
 NS_IMETHODIMP
 nsWindowMediator::GetMostRecentWindow(const char16_t* inType,
-                                      mozIDOMWindowProxy** outWindow)
+                                      nsPIDOMWindowOuter** outWindow)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   NS_ENSURE_ARG_POINTER(outWindow);
   *outWindow = nullptr;
   if (!mReady)
     return NS_OK;
 
   // Find the most window with the highest time stamp that matches
@@ -277,17 +277,17 @@ nsWindowMediator::GetMostRecentWindow(co
     }
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWindowMediator::GetMostRecentNonPBWindow(const char16_t* aType, mozIDOMWindowProxy** aWindow)
+nsWindowMediator::GetMostRecentNonPBWindow(const char16_t* aType, nsPIDOMWindowOuter** aWindow)
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   NS_ENSURE_ARG_POINTER(aWindow);
   *aWindow = nullptr;
 
   nsWindowInfo *info = MostRecentWindowInfo(aType, true);
   nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   if (info && info->mWindow) {
@@ -345,27 +345,27 @@ nsWindowMediator::MostRecentWindowInfo(c
     lastTimeStamp = searchInfo->mTimeStamp;
   }
 
   return foundInfo;
 }
 
 NS_IMETHODIMP
 nsWindowMediator::GetOuterWindowWithId(uint64_t aWindowID,
-                                       mozIDOMWindowProxy** aWindow)
+                                       nsPIDOMWindowOuter** aWindow)
 {
   RefPtr<nsGlobalWindowOuter> window = nsGlobalWindowOuter::GetOuterWindowWithId(aWindowID);
   nsCOMPtr<nsPIDOMWindowOuter> outer = window ? window->AsOuter() : nullptr;
   outer.forget(aWindow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindowMediator::GetCurrentInnerWindowWithId(uint64_t aWindowID,
-                                              mozIDOMWindow** aWindow)
+                                              nsPIDOMWindowInner** aWindow)
 {
   RefPtr<nsGlobalWindowInner> window = nsGlobalWindowInner::GetInnerWindowWithId(aWindowID);
 
   // not found
   if (!window)
     return NS_OK;
 
   nsCOMPtr<nsPIDOMWindowInner> inner = window->AsInner();
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -149,21 +149,21 @@ NS_IMETHODIMP nsXULWindow::GetInterface(
     if (NS_FAILED(rv)) return rv;
     return mPrompter->QueryInterface(aIID, aSink);
   }
   if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) {
     rv = EnsureAuthPrompter();
     if (NS_FAILED(rv)) return rv;
     return mAuthPrompter->QueryInterface(aIID, aSink);
   }
-  if (aIID.Equals(NS_GET_IID(mozIDOMWindowProxy))) {
-    return GetWindowDOMWindow(reinterpret_cast<mozIDOMWindowProxy**>(aSink));
+  if (aIID.Equals(NS_GET_IID(nsPIDOMWindowOuter))) {
+    return GetWindowDOMWindow(reinterpret_cast<nsPIDOMWindowOuter**>(aSink));
   }
   if (aIID.Equals(NS_GET_IID(nsIDOMWindow))) {
-    nsCOMPtr<mozIDOMWindowProxy> window = nullptr;
+    nsCOMPtr<nsPIDOMWindowOuter> window = nullptr;
     rv = GetWindowDOMWindow(getter_AddRefs(window));
     nsCOMPtr<nsIDOMWindow> domWindow = do_QueryInterface(window);
     domWindow.forget(aSink);
     return rv;
   }
   if (aIID.Equals(NS_GET_IID(nsIWebBrowserChrome)) &&
     NS_SUCCEEDED(EnsureContentTreeOwner()) &&
     NS_SUCCEEDED(mContentTreeOwner->QueryInterface(aIID, aSink)))
@@ -995,45 +995,45 @@ NS_IMETHODIMP nsXULWindow::EnsurePrimary
   return NS_OK;
 }
 
 NS_IMETHODIMP nsXULWindow::EnsurePrompter()
 {
   if (mPrompter)
     return NS_OK;
 
-  nsCOMPtr<mozIDOMWindowProxy> ourWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> ourWindow;
   nsresult rv = GetWindowDOMWindow(getter_AddRefs(ourWindow));
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIWindowWatcher> wwatch =
         do_GetService(NS_WINDOWWATCHER_CONTRACTID);
     if (wwatch)
       wwatch->GetNewPrompter(ourWindow, getter_AddRefs(mPrompter));
   }
   return mPrompter ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP nsXULWindow::EnsureAuthPrompter()
 {
   if (mAuthPrompter)
     return NS_OK;
 
-  nsCOMPtr<mozIDOMWindowProxy> ourWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> ourWindow;
   nsresult rv = GetWindowDOMWindow(getter_AddRefs(ourWindow));
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
     if (wwatch)
       wwatch->GetNewAuthPrompter(ourWindow, getter_AddRefs(mAuthPrompter));
   }
   return mAuthPrompter ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP nsXULWindow::GetAvailScreenSize(int32_t* aAvailWidth, int32_t* aAvailHeight)
 {
-  nsCOMPtr<mozIDOMWindowProxy> domWindow;
+  nsCOMPtr<nsPIDOMWindowOuter> domWindow;
   GetWindowDOMWindow(getter_AddRefs(domWindow));
   NS_ENSURE_STATE(domWindow);
 
   auto* window = nsGlobalWindowOuter::Cast(domWindow);
 
   RefPtr<nsScreen> screen = window->GetScreen();
   NS_ENSURE_STATE(screen);
 
@@ -1373,17 +1373,17 @@ bool nsXULWindow::LoadMiscPersistentAttr
       sizeString.Assign(SIZEMODE_NORMAL);
     if (!sizeString.IsEmpty()) {
       ErrorResult rv;
       windowElement->SetAttribute(MODE_ATTRIBUTE, sizeString, rv);
     }
   }
 
   if (sizeMode == nsSizeMode_Fullscreen) {
-    nsCOMPtr<mozIDOMWindowProxy> ourWindow;
+    nsCOMPtr<nsPIDOMWindowOuter> ourWindow;
     GetWindowDOMWindow(getter_AddRefs(ourWindow));
     auto* piWindow = nsPIDOMWindowOuter::From(ourWindow);
     piWindow->SetFullScreen(true);
   } else {
     // For maximized windows, ignore the XUL size and position attributes,
     // as setting them would set the window back to normal sizemode.
     if (sizeMode == nsSizeMode_Maximized) {
       mIgnoreXULSize = true;
@@ -1852,17 +1852,17 @@ NS_IMETHODIMP nsXULWindow::SavePersisten
       }
     }
   }
 
   mPersistentAttributesDirty = 0;
   return NS_OK;
 }
 
-NS_IMETHODIMP nsXULWindow::GetWindowDOMWindow(mozIDOMWindowProxy** aDOMWindow)
+NS_IMETHODIMP nsXULWindow::GetWindowDOMWindow(nsPIDOMWindowOuter** aDOMWindow)
 {
   NS_ENSURE_STATE(mDocShell);
 
   if (!mDOMWindow)
     mDOMWindow = mDocShell->GetWindow();
   NS_ENSURE_TRUE(mDOMWindow, NS_ERROR_FAILURE);
 
   *aDOMWindow = mDOMWindow;
@@ -2032,33 +2032,33 @@ NS_IMETHODIMP nsXULWindow::ExitModalLoop
   mContinueModalLoop = false;
   mModalStatus = aStatus;
   return NS_OK;
 }
 
 // top-level function to create a new window
 NS_IMETHODIMP nsXULWindow::CreateNewWindow(int32_t aChromeFlags,
                                            nsITabParent *aOpeningTab,
-                                           mozIDOMWindowProxy *aOpener,
+                                           nsPIDOMWindowOuter *aOpener,
                                            uint64_t aNextTabParentId,
                                            nsIXULWindow **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
 
   if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME) {
     MOZ_RELEASE_ASSERT(aNextTabParentId == 0,
                        "Unexpected next tab parent ID, should never have a non-zero nextTabParentId when creating a new chrome window");
     return CreateNewChromeWindow(aChromeFlags, aOpeningTab, aOpener, _retval);
   }
   return CreateNewContentWindow(aChromeFlags, aOpeningTab, aOpener, aNextTabParentId, _retval);
 }
 
 NS_IMETHODIMP nsXULWindow::CreateNewChromeWindow(int32_t aChromeFlags,
                                                  nsITabParent *aOpeningTab,
-                                                 mozIDOMWindowProxy *aOpener,
+                                                 nsPIDOMWindowOuter *aOpener,
                                                  nsIXULWindow **_retval)
 {
   nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
   NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
 
   // Just do a normal create of a window and return.
   nsCOMPtr<nsIXULWindow> newWindow;
   appShell->CreateTopLevelWindow(this, nullptr, aChromeFlags,
@@ -2072,17 +2072,17 @@ NS_IMETHODIMP nsXULWindow::CreateNewChro
   *_retval = newWindow;
   NS_ADDREF(*_retval);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsXULWindow::CreateNewContentWindow(int32_t aChromeFlags,
                                                   nsITabParent *aOpeningTab,
-                                                  mozIDOMWindowProxy *aOpener,
+                                                  nsPIDOMWindowOuter *aOpener,
                                                   uint64_t aNextTabParentId,
                                                   nsIXULWindow **_retval)
 {
   nsCOMPtr<nsIAppShellService> appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID));
   NS_ENSURE_TRUE(appShell, NS_ERROR_FAILURE);
 
   // We need to create a new top level window and then enter a nested
   // loop. Eventually the new window will be told that it has loaded,
--- a/xpfe/appshell/nsXULWindow.h
+++ b/xpfe/appshell/nsXULWindow.h
@@ -103,17 +103,17 @@ protected:
                         int32_t aSpecWidth, int32_t aSpecHeight);
    bool       LoadPositionFromXUL(int32_t aSpecWidth, int32_t aSpecHeight);
    bool       LoadSizeFromXUL(int32_t& aSpecWidth, int32_t& aSpecHeight);
    void       SetSpecifiedSize(int32_t aSpecWidth, int32_t aSpecHeight);
    bool       LoadMiscPersistentAttributesFromXUL();
    void       SyncAttributesToWidget();
    NS_IMETHOD SavePersistentAttributes();
 
-   NS_IMETHOD GetWindowDOMWindow(mozIDOMWindowProxy** aDOMWindow);
+   NS_IMETHOD GetWindowDOMWindow(nsPIDOMWindowOuter** aDOMWindow);
    mozilla::dom::Element* GetWindowDOMElement() const;
 
    // See nsIDocShellTreeOwner for docs on next two methods
    nsresult ContentShellAdded(nsIDocShellTreeItem* aContentShell,
                               bool aPrimary);
    nsresult ContentShellRemoved(nsIDocShellTreeItem* aContentShell);
    NS_IMETHOD GetPrimaryContentSize(int32_t* aWidth,
                                     int32_t* aHeight);
@@ -122,20 +122,20 @@ protected:
    nsresult GetRootShellSize(int32_t* aWidth,
                              int32_t* aHeight);
    nsresult SetRootShellSize(int32_t aWidth,
                              int32_t aHeight);
 
    NS_IMETHOD SizeShellTo(nsIDocShellTreeItem* aShellItem, int32_t aCX,
       int32_t aCY);
    NS_IMETHOD ExitModalLoop(nsresult aStatus);
-   NS_IMETHOD CreateNewChromeWindow(int32_t aChromeFlags, nsITabParent* aOpeningTab, mozIDOMWindowProxy* aOpenerWindow, nsIXULWindow **_retval);
+   NS_IMETHOD CreateNewChromeWindow(int32_t aChromeFlags, nsITabParent* aOpeningTab, nsPIDOMWindowOuter* aOpenerWindow, nsIXULWindow **_retval);
    NS_IMETHOD CreateNewContentWindow(int32_t aChromeFlags,
                                      nsITabParent* aOpeningTab,
-                                     mozIDOMWindowProxy* aOpenerWindow,
+                                     nsPIDOMWindowOuter* aOpenerWindow,
                                      uint64_t aNextTabParentId,
                                      nsIXULWindow **_retval);
    NS_IMETHOD GetHasPrimaryContent(bool* aResult);
 
    void       EnableParent(bool aEnable);
    bool       ConstrainToZLevel(bool aImmediate, nsWindowZ *aPlacement,
                                 nsIWidget *aReqBelow, nsIWidget **aActualBelow);
    void       PlaceWindowLayersBehind(uint32_t aLowLevel, uint32_t aHighLevel,