diff --git a/accessible/base/DocManager.cpp b/accessible/base/DocManager.cpp index 6318ce961b1d..c82f2f01b7c8 100644 --- a/accessible/base/DocManager.cpp +++ b/accessible/base/DocManager.cpp @@ -26,7 +26,6 @@ #include "nsDocShellLoadTypes.h" #include "nsIChannel.h" #include "nsIDOMDocument.h" -#include "nsIDOMWindow.h" #include "nsIInterfaceRequestorUtils.h" #include "nsIWebNavigation.h" #include "nsServiceManagerUtils.h" @@ -218,11 +217,11 @@ DocManager::OnStateChange(nsIWebProgress* aWebProgress, (aStateFlags & (STATE_START | STATE_STOP)) == 0) return NS_OK; - nsCOMPtr DOMWindow; + nsCOMPtr DOMWindow; aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow)); NS_ENSURE_STATE(DOMWindow); - nsCOMPtr piWindow = do_QueryInterface(DOMWindow); + nsPIDOMWindowOuter* piWindow = nsPIDOMWindowOuter::From(DOMWindow); MOZ_ASSERT(piWindow); nsCOMPtr document = piWindow->GetDoc(); @@ -403,7 +402,7 @@ void DocManager::AddListeners(nsIDocument* aDocument, bool aAddDOMContentLoadedListener) { - nsPIDOMWindow* window = aDocument->GetWindow(); + nsPIDOMWindowOuter* window = aDocument->GetWindow(); EventTarget* target = window->GetChromeEventHandler(); EventListenerManager* elm = target->GetOrCreateListenerManager(); elm->AddEventListenerByType(this, NS_LITERAL_STRING("pagehide"), @@ -427,7 +426,7 @@ DocManager::AddListeners(nsIDocument* aDocument, void DocManager::RemoveListeners(nsIDocument* aDocument) { - nsPIDOMWindow* window = aDocument->GetWindow(); + nsPIDOMWindowOuter* window = aDocument->GetWindow(); if (!window) return; diff --git a/accessible/base/FocusManager.cpp b/accessible/base/FocusManager.cpp index 5b8b922e847d..42088c4fe5c9 100644 --- a/accessible/base/FocusManager.cpp +++ b/accessible/base/FocusManager.cpp @@ -389,7 +389,7 @@ FocusManager::FocusedDOMNode() const } // Otherwise the focus can be on DOM document. - nsPIDOMWindow* focusedWnd = DOMFocusManager->GetFocusedWindow(); + nsPIDOMWindowOuter* focusedWnd = DOMFocusManager->GetFocusedWindow(); return focusedWnd ? focusedWnd->GetExtantDoc() : nullptr; } diff --git a/accessible/base/Logging.cpp b/accessible/base/Logging.cpp index a080c35e57ae..f345cc3bcdc5 100644 --- a/accessible/base/Logging.cpp +++ b/accessible/base/Logging.cpp @@ -392,9 +392,9 @@ logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress, { MsgBegin(sDocLoadTitle, aMsg); - nsCOMPtr DOMWindow; + nsCOMPtr DOMWindow; aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow)); - nsCOMPtr window = do_QueryInterface(DOMWindow); + nsPIDOMWindowOuter* window = nsPIDOMWindowOuter::From(DOMWindow); if (!window) { MsgEnd(); return; diff --git a/accessible/generic/ApplicationAccessible.cpp b/accessible/generic/ApplicationAccessible.cpp index 69537e26b82d..ed4594c756ed 100644 --- a/accessible/generic/ApplicationAccessible.cpp +++ b/accessible/generic/ApplicationAccessible.cpp @@ -15,7 +15,6 @@ #include "nsIComponentManager.h" #include "nsIDOMDocument.h" -#include "nsIDOMWindow.h" #include "nsIWindowMediator.h" #include "nsServiceManagerUtils.h" #include "mozilla/Services.h" @@ -193,7 +192,7 @@ ApplicationAccessible::CacheChildren() while (hasMore) { nsCOMPtr window; windowEnumerator->GetNext(getter_AddRefs(window)); - nsCOMPtr DOMWindow = do_QueryInterface(window); + nsCOMPtr DOMWindow = do_QueryInterface(window); if (DOMWindow) { nsCOMPtr docNode = DOMWindow->GetDoc(); if (docNode) { diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp index e344599ecdee..e0da87515bec 100644 --- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -1360,7 +1360,7 @@ HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos) NS_ENSURE_TRUE(mDoc, NS_ERROR_FAILURE); nsIDocument* docNode = mDoc->DocumentNode(); NS_ENSURE_TRUE(docNode, NS_ERROR_FAILURE); - nsCOMPtr window = docNode->GetWindow(); + nsCOMPtr window = docNode->GetWindow(); nsCOMPtr result; DOMFocusManager->MoveFocus(window, nullptr, nsIFocusManager::MOVEFOCUS_CARET, nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result)); diff --git a/accessible/generic/ImageAccessible.cpp b/accessible/generic/ImageAccessible.cpp index cd9a7f443786..0adf5905e891 100644 --- a/accessible/generic/ImageAccessible.cpp +++ b/accessible/generic/ImageAccessible.cpp @@ -132,11 +132,11 @@ ImageAccessible::DoAction(uint8_t aIndex) NS_ConvertUTF8toUTF16 spec(utf8spec); nsIDocument* document = mContent->OwnerDoc(); - nsCOMPtr piWindow = document->GetWindow(); + nsCOMPtr piWindow = document->GetWindow(); if (!piWindow) return false; - nsCOMPtr tmp; + nsCOMPtr tmp; return NS_SUCCEEDED(piWindow->Open(spec, EmptyString(), EmptyString(), getter_AddRefs(tmp))); } diff --git a/accessible/generic/RootAccessible.cpp b/accessible/generic/RootAccessible.cpp index b2077824e4a7..e1acc4b5a8eb 100644 --- a/accessible/generic/RootAccessible.cpp +++ b/accessible/generic/RootAccessible.cpp @@ -485,12 +485,10 @@ RootAccessible::RelationByType(RelationType aType) if (!mDocumentNode || aType != RelationType::EMBEDS) return DocAccessibleWrap::RelationByType(aType); - nsPIDOMWindow* rootWindow = mDocumentNode->GetWindow(); - if (rootWindow) { - nsCOMPtr contentWindow = nsGlobalWindow::Cast(rootWindow)->GetContent(); - nsCOMPtr piWindow = do_QueryInterface(contentWindow); - if (piWindow) { - nsCOMPtr contentDocumentNode = piWindow->GetDoc(); + if (nsPIDOMWindowOuter* rootWindow = mDocumentNode->GetWindow()) { + nsCOMPtr contentWindow = nsGlobalWindow::Cast(rootWindow)->GetContent(); + if (contentWindow) { + nsCOMPtr contentDocumentNode = contentWindow->GetDoc(); if (contentDocumentNode) { DocAccessible* contentDocument = GetAccService()->GetDocAccessible(contentDocumentNode); diff --git a/accessible/interfaces/nsIAccessibleDocument.idl b/accessible/interfaces/nsIAccessibleDocument.idl index bd4334d4d517..7e10bef8f3c0 100644 --- a/accessible/interfaces/nsIAccessibleDocument.idl +++ b/accessible/interfaces/nsIAccessibleDocument.idl @@ -7,7 +7,7 @@ interface nsIAccessiblePivot; interface nsIDOMDocument; -interface nsIDOMWindow; +interface mozIDOMWindowProxy; /** * An interface for in-process accessibility clients @@ -19,7 +19,7 @@ interface nsIDOMWindow; * the root node of a document or you can get one from * nsIAccessible::GetDocument(). */ -[scriptable, uuid(2be938df-0210-4609-9ece-26b197a517e5)] +[scriptable, uuid(5cad5f91-fcce-40e7-913e-4671701d19b4)] interface nsIAccessibleDocument : nsISupports { /** @@ -50,7 +50,7 @@ interface nsIAccessibleDocument : nsISupports /** * The nsIDOMWindow that the document resides in. */ - readonly attribute nsIDOMWindow window; + readonly attribute mozIDOMWindowProxy window; /** * Return the parent document accessible. diff --git a/accessible/interfaces/nsIAccessibleRetrieval.idl b/accessible/interfaces/nsIAccessibleRetrieval.idl index cd9939bbdb3c..168d4a5095d2 100644 --- a/accessible/interfaces/nsIAccessibleRetrieval.idl +++ b/accessible/interfaces/nsIAccessibleRetrieval.idl @@ -9,7 +9,6 @@ interface nsIDOMNode; interface nsIAccessible; interface nsIWeakReference; interface nsIPresShell; -interface nsIDOMWindow; interface nsIAccessiblePivot; /** diff --git a/accessible/windows/msaa/nsWinUtils.cpp b/accessible/windows/msaa/nsWinUtils.cpp index 6fc7f168b3e6..8692244ebb2c 100644 --- a/accessible/windows/msaa/nsWinUtils.cpp +++ b/accessible/windows/msaa/nsWinUtils.cpp @@ -45,8 +45,7 @@ nsWinUtils::GetComputedStyleDeclaration(nsIContent* aContent) return nullptr; // Returns number of items in style declaration - nsCOMPtr window = - do_QueryInterface(elm->OwnerDoc()->GetInnerWindow()); + nsCOMPtr window = elm->OwnerDoc()->GetInnerWindow(); if (!window) return nullptr; diff --git a/accessible/xpcom/xpcAccessibleDocument.cpp b/accessible/xpcom/xpcAccessibleDocument.cpp index 601cf06fd4fc..d4726dbe60d9 100644 --- a/accessible/xpcom/xpcAccessibleDocument.cpp +++ b/accessible/xpcom/xpcAccessibleDocument.cpp @@ -99,7 +99,7 @@ xpcAccessibleDocument::GetDOMDocument(nsIDOMDocument** aDOMDocument) } NS_IMETHODIMP -xpcAccessibleDocument::GetWindow(nsIDOMWindow** aDOMWindow) +xpcAccessibleDocument::GetWindow(mozIDOMWindowProxy** aDOMWindow) { NS_ENSURE_ARG_POINTER(aDOMWindow); *aDOMWindow = nullptr; diff --git a/accessible/xpcom/xpcAccessibleDocument.h b/accessible/xpcom/xpcAccessibleDocument.h index 5d21683e6ad7..7cf45518e020 100644 --- a/accessible/xpcom/xpcAccessibleDocument.h +++ b/accessible/xpcom/xpcAccessibleDocument.h @@ -41,7 +41,7 @@ public: NS_IMETHOD GetMimeType(nsAString& aType) final override; NS_IMETHOD GetDocType(nsAString& aType) final override; NS_IMETHOD GetDOMDocument(nsIDOMDocument** aDOMDocument) final override; - NS_IMETHOD GetWindow(nsIDOMWindow** aDOMWindow) final override; + NS_IMETHOD GetWindow(mozIDOMWindowProxy** aDOMWindow) final override; NS_IMETHOD GetParentDocument(nsIAccessibleDocument** aDocument) final override; NS_IMETHOD GetChildDocumentCount(uint32_t* aCount) final override; diff --git a/chrome/nsChromeRegistry.cpp b/chrome/nsChromeRegistry.cpp index e12fd9555e2a..4ecb3bd2953c 100644 --- a/chrome/nsChromeRegistry.cpp +++ b/chrome/nsChromeRegistry.cpp @@ -313,7 +313,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult) // theme stuff -static void FlushSkinBindingsForWindow(nsPIDOMWindow* aWindow) +static void FlushSkinBindingsForWindow(nsPIDOMWindowOuter* aWindow) { // Get the document. nsCOMPtr document = aWindow->GetDoc(); @@ -340,7 +340,7 @@ NS_IMETHODIMP nsChromeRegistry::RefreshSkins() nsCOMPtr protoWindow; windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) FlushSkinBindingsForWindow(domWindow); } @@ -355,7 +355,7 @@ NS_IMETHODIMP nsChromeRegistry::RefreshSkins() nsCOMPtr protoWindow; windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) RefreshWindow(domWindow); } @@ -377,7 +377,7 @@ nsChromeRegistry::FlushSkinCaches() } // XXXbsmedberg: move this to windowmediator -nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindow* aWindow) +nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindowOuter* aWindow) { // Deal with our subframes first. nsCOMPtr frames = aWindow->GetFrames(); @@ -385,9 +385,9 @@ nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindow* aWindow) frames->GetLength(&length); uint32_t j; for (j = 0; j < length; j++) { - nsCOMPtr childWin; + nsCOMPtr childWin; frames->Item(j, getter_AddRefs(childWin)); - nsCOMPtr piWindow = do_QueryInterface(childWin); + nsCOMPtr piWindow = nsPIDOMWindowOuter::From(childWin); RefreshWindow(piWindow); } @@ -503,7 +503,7 @@ nsChromeRegistry::ReloadChrome() nsCOMPtr protoWindow; rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (NS_SUCCEEDED(rv)) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) { nsIDOMLocation* location = domWindow->GetLocation(); if (location) { diff --git a/chrome/nsChromeRegistry.h b/chrome/nsChromeRegistry.h index c9176cb3e2d9..c409e09bd3af 100644 --- a/chrome/nsChromeRegistry.h +++ b/chrome/nsChromeRegistry.h @@ -22,7 +22,7 @@ #include "mozilla/FileLocation.h" -class nsPIDOMWindow; +class nsPIDOMWindowOuter; class nsIPrefBranch; class nsIURL; @@ -95,7 +95,7 @@ protected: nsresult SelectLocaleFromPref(nsIPrefBranch* prefs); - static nsresult RefreshWindow(nsPIDOMWindow* aWindow); + static nsresult RefreshWindow(nsPIDOMWindowOuter* aWindow); static nsresult GetProviderAndPath(nsIURL* aChromeURL, nsACString& aProvider, nsACString& aPath); diff --git a/docshell/base/LoadContext.cpp b/docshell/base/LoadContext.cpp index 6701d45777e9..99d5bfb86012 100644 --- a/docshell/base/LoadContext.cpp +++ b/docshell/base/LoadContext.cpp @@ -69,7 +69,7 @@ LoadContext::LoadContext(nsIPrincipal* aPrincipal, //----------------------------------------------------------------------------- NS_IMETHODIMP -LoadContext::GetAssociatedWindow(nsIDOMWindow**) +LoadContext::GetAssociatedWindow(mozIDOMWindowProxy**) { MOZ_ASSERT(mIsNotNull); @@ -78,7 +78,7 @@ LoadContext::GetAssociatedWindow(nsIDOMWindow**) } NS_IMETHODIMP -LoadContext::GetTopWindow(nsIDOMWindow**) +LoadContext::GetTopWindow(mozIDOMWindowProxy**) { MOZ_ASSERT(mIsNotNull); diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index 98de0eef0530..72bbdfe1d993 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -148,8 +148,8 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType, } if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) { - nsCOMPtr domWindow = do_QueryInterface( - mDocShell ? mDocShell->GetWindow() : nullptr); + nsCOMPtr domWindow = + mDocShell ? mDocShell->GetWindow() : nullptr; NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE); domWindow->Focus(); } @@ -294,7 +294,7 @@ nsDSURIContentListener::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel, // window, if we're not the top. X-F-O: SAMEORIGIN requires that the // document must be same-origin with top window. X-F-O: DENY requires that // the document must never be framed. - nsCOMPtr thisWindow = mDocShell->GetWindow(); + nsCOMPtr thisWindow = mDocShell->GetWindow(); // If we don't have DOMWindow there is no risk of clickjacking if (!thisWindow) { return true; @@ -302,7 +302,7 @@ nsDSURIContentListener::CheckOneFrameOptionsPolicy(nsIHttpChannel* aHttpChannel, // GetScriptableTop, not GetTop, because we want this to respect //