From 0a175de4e577f44874cf3208a3635c8d21f64ae0 Mon Sep 17 00:00:00 2001 From: "vidur@netscape.com" Date: Fri, 1 Sep 2000 01:54:35 +0000 Subject: [PATCH] Fix for bug 46861. nsIDOMWindow is now split into two interfaces: a public interface (still called nsIDOMWindow) for embedders and an internal interface (nsIDOMWindowInternal) for internal use. The union of the two interfaces is still visible from JavaScript. r=jst@netscape.com --- chrome/src/nsChromeRegistry.cpp | 6 +- chrome/src/nsChromeRegistry.h | 4 +- chrome/src/nsChromeUIDataSource.h | 2 +- content/base/src/nsDocument.cpp | 14 +- content/base/src/nsDocumentViewer.cpp | 4 +- content/events/src/nsDOMEvent.cpp | 6 +- content/events/src/nsEventStateManager.cpp | 14 +- .../content/public/nsIFormSubmitObserver.h | 4 +- .../html/content/src/nsHTMLImageElement.cpp | 6 +- .../html/content/src/nsHTMLSpacerElement.cpp | 2 +- content/html/document/src/nsHTMLDocument.cpp | 4 +- .../xul/content/src/nsXULPopupListener.cpp | 4 +- .../document/src/nsXULCommandDispatcher.cpp | 22 +- .../xul/document/src/nsXULCommandDispatcher.h | 4 +- content/xul/document/src/nsXULDocument.cpp | 10 +- .../document/src/nsXULPrototypeDocument.cpp | 4 +- docshell/base/nsDocShell.cpp | 11 +- docshell/base/nsWebShell.cpp | 9 +- dom/public/base/MANIFEST | 1 + dom/public/base/Makefile.in | 1 + dom/public/base/makefile.win | 3 +- dom/public/base/nsIDOMWindow.h | 317 -- dom/public/base/nsPIDOMWindow.h | 4 +- dom/public/domstubs.idl | 4 + dom/public/idl/base/Window.idl | 40 +- dom/public/nsDOMPropEnums.h | 132 +- dom/public/nsDOMPropNames.h | 132 +- dom/public/nsIScriptGlobalObject.h | 4 +- dom/public/xul/nsIDOMXULCommandDispatcher.h | 14 +- dom/src/base/nsBarProps.cpp | 4 +- dom/src/base/nsGlobalWindow.cpp | 85 +- dom/src/base/nsGlobalWindow.h | 23 +- dom/src/base/nsHistory.cpp | 2 +- dom/src/base/nsJSEnvironment.cpp | 2 +- dom/src/base/nsJSWindow.cpp | 3162 ++++++++++------- dom/src/events/nsJSEvent.cpp | 6 +- dom/src/jsurl/nsJSProtocolHandler.cpp | 6 +- dom/src/xul/nsJSXULCommandDispatcher.cpp | 6 +- editor/base/nsComposerCommands.cpp | 6 +- editor/base/nsEditorShell.cpp | 40 +- editor/base/nsEditorShell.h | 8 +- editor/base/nsInterfaceState.cpp | 4 +- editor/base/nsInterfaceState.h | 2 +- editor/composer/src/nsComposerCommands.cpp | 6 +- editor/composer/src/nsEditorShell.cpp | 40 +- editor/composer/src/nsEditorShell.h | 8 +- editor/composer/src/nsInterfaceState.cpp | 4 +- editor/composer/src/nsInterfaceState.h | 2 +- editor/idl/nsIEditorShell.idl | 10 +- .../activex/src/control/MozillaBrowser.cpp | 4 +- .../psm-glue/public/nsISecureBrowserUI.idl | 4 +- extensions/psm-glue/src/nsCrypto.cpp | 6 +- extensions/psm-glue/src/nsPSMUICallbacks.cpp | 8 +- .../psm-glue/src/nsSecureBrowserUIImpl.cpp | 8 +- .../psm-glue/src/nsSecureBrowserUIImpl.h | 6 +- extensions/xmlterm/base/mozIXMLTermShell.idl | 4 +- extensions/xmlterm/base/mozIXMLTermStream.h | 2 +- extensions/xmlterm/base/mozXMLTermSession.cpp | 4 +- extensions/xmlterm/base/mozXMLTermShell.cpp | 4 +- extensions/xmlterm/base/mozXMLTermShell.h | 4 +- extensions/xmlterm/base/mozXMLTermStream.cpp | 6 +- extensions/xmlterm/base/mozXMLTermStream.h | 4 +- extensions/xmlterm/base/mozXMLTermUtils.cpp | 10 +- extensions/xmlterm/base/mozXMLTermUtils.h | 10 +- extensions/xmlterm/base/mozXMLTerminal.cpp | 2 +- gfx/src/gtk/nsDeviceContextSpecG.cpp | 8 +- gfx/src/xlib/nsDeviceContextSpecXlib.cpp | 8 +- layout/base/nsCSSFrameConstructor.cpp | 2 +- layout/base/nsDocumentViewer.cpp | 4 +- layout/base/nsPresShell.cpp | 14 +- layout/base/src/nsDocument.cpp | 14 +- layout/base/src/nsDocumentViewer.cpp | 4 +- layout/events/src/nsDOMEvent.cpp | 6 +- layout/events/src/nsEventStateManager.cpp | 14 +- layout/forms/nsFileControlFrame.cpp | 6 +- layout/html/base/src/nsPresShell.cpp | 14 +- .../html/content/src/nsHTMLImageElement.cpp | 6 +- .../html/content/src/nsHTMLSpacerElement.cpp | 2 +- layout/html/document/src/nsHTMLDocument.cpp | 4 +- .../html/forms/public/nsIFormSubmitObserver.h | 4 +- layout/html/forms/src/nsFileControlFrame.cpp | 6 +- layout/html/forms/src/nsFormFrame.cpp | 4 +- .../html/forms/src/nsGfxTextControlFrame.cpp | 4 +- .../html/forms/src/nsGfxTextControlFrame2.cpp | 4 +- .../html/style/src/nsCSSFrameConstructor.cpp | 2 +- layout/xul/base/src/nsMenuPopupFrame.cpp | 4 +- layout/xul/base/src/nsTitleBarFrame.cpp | 4 +- profile/pref-migrator/src/nsPrefMigration.cpp | 6 +- profile/pref-migrator/src/nsPrefMigration.h | 4 +- profile/src/nsProfile.cpp | 6 +- rdf/chrome/src/nsChromeRegistry.cpp | 6 +- rdf/chrome/src/nsChromeRegistry.h | 4 +- rdf/chrome/src/nsChromeUIDataSource.h | 2 +- .../public/nsIDOMXULCommandDispatcher.h | 14 +- rdf/content/src/nsDlgDefaultKeys.cpp | 2 +- rdf/content/src/nsJSXULCommandDispatcher.cpp | 6 +- rdf/content/src/nsXULCommandDispatcher.cpp | 22 +- rdf/content/src/nsXULCommandDispatcher.h | 4 +- rdf/content/src/nsXULDocument.cpp | 10 +- rdf/content/src/nsXULKeyListener.cpp | 6 +- rdf/content/src/nsXULPopupListener.cpp | 4 +- rdf/content/src/nsXULPrototypeDocument.cpp | 4 +- rdf/tests/domds/nsIDOMDataSource.idl | 4 +- rdf/tests/domds/nsRDFDOMDataSource.cpp | 2 +- uriloader/base/nsURILoader.cpp | 8 +- webshell/embed/xlib/qt/QMozillaContainer.cpp | 4 +- webshell/embed/xlib/qt/QMozillaContainer.h | 2 +- webshell/public/nsIWebShell.h | 2 +- widget/public/nsIFilePicker.idl | 6 +- widget/public/nsIFileSpecWithUI.idl | 4 +- widget/src/gtk/nsFilePicker.cpp | 2 +- widget/src/gtk/nsGtkMozRemoteHelper.cpp | 20 +- widget/src/gtk/nsGtkMozRemoteHelper.h | 8 +- widget/src/os2/nsFilePicker.cpp | 2 +- widget/src/xpwidgets/nsBaseFilePicker.cpp | 6 +- widget/src/xpwidgets/nsBaseFilePicker.h | 4 +- widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp | 8 +- widget/src/xpwidgets/nsFileSpecWithUIImpl.h | 2 +- xpcom/tests/SizeTest06.cpp | 20 +- xpfe/appshell/public/nsIAppShellService.idl | 8 +- xpfe/appshell/public/nsICommonDialogs.idl | 20 +- xpfe/appshell/public/nsIWebShellWindow.h | 6 +- xpfe/appshell/public/nsIWindowMediator.idl | 6 +- xpfe/appshell/src/nsAppShellService.cpp | 20 +- xpfe/appshell/src/nsCommandLineServiceMac.cpp | 6 +- xpfe/appshell/src/nsCommonDialogs.cpp | 24 +- xpfe/appshell/src/nsContentTreeOwner.cpp | 4 +- xpfe/appshell/src/nsNetSupportDialog.cpp | 2 +- xpfe/appshell/src/nsWebShellWindow.cpp | 26 +- xpfe/appshell/src/nsWebShellWindow.h | 6 +- xpfe/appshell/src/nsWindowMediator.cpp | 20 +- xpfe/appshell/src/nsXULWindow.cpp | 8 +- xpfe/appshell/src/nsXULWindow.h | 6 +- xpfe/bootstrap/nsAppRunner.cpp | 8 +- xpfe/bootstrap/nsNativeAppSupportWin.cpp | 6 +- xpfe/browser/public/nsIBrowserInstance.idl | 10 +- xpfe/browser/src/nsBrowserInstance.cpp | 26 +- xpfe/browser/src/nsBrowserInstance.h | 6 +- .../bookmarks/src/nsBookmarksService.cpp | 6 +- .../find/public/nsIFindComponent.idl | 6 +- .../find/public/nsISearchContext.idl | 4 +- xpfe/components/find/src/nsFindComponent.cpp | 34 +- xpfe/components/find/src/nsFindComponent.h | 10 +- .../sample/src/nsSampleAppShellComponent.cpp | 6 +- xpfe/components/sidebar/public/nsISidebar.idl | 4 +- .../startup/src/nsCommandLineServiceMac.cpp | 6 +- .../ucth/public/nsIUnkContentTypeHandler.idl | 2 +- .../ucth/src/nsUnknownContentTypeHandler.cpp | 10 +- xpfe/components/urlwidget/nsIUrlWidget.idl | 2 +- xpfe/components/urlwidget/nsUrlWidget.cpp | 4 +- .../xfer/public/nsIStreamTransfer.idl | 4 +- xpfe/components/xfer/src/nsStreamTransfer.cpp | 12 +- xpfe/components/xfer/src/nsStreamXferOp.cpp | 10 +- xpfe/components/xfer/src/nsStreamXferOp.h | 4 +- xpinstall/src/nsInstallProgressDialog.cpp | 4 +- xpinstall/src/nsInstallProgressDialog.h | 4 +- xpinstall/src/nsXPInstallManager.cpp | 8 +- 157 files changed, 2608 insertions(+), 2386 deletions(-) diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index 300188cef837..fd9edd44674c 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -51,7 +51,7 @@ #include "nsIFileLocator.h" #include "nsIXBLService.h" #include "nsPIDOMWindow.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowCollection.h" #include "nsIDOMLocation.h" #include "nsIWindowMediator.h" @@ -1069,7 +1069,7 @@ NS_IMETHODIMP nsChromeRegistry::RefreshSkins() nsCOMPtr protoWindow; rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (NS_SUCCEEDED(rv) && protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) { rv = RefreshWindow(domWindow); if (NS_FAILED(rv)) return rv; @@ -1103,7 +1103,7 @@ static PRBool IsChromeURI(nsIURI* aURI) return PR_FALSE; } -NS_IMETHODIMP nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow) +NS_IMETHODIMP nsChromeRegistry::RefreshWindow(nsIDOMWindowInternal* aWindow) { nsresult rv; // Get the DOM document. diff --git a/chrome/src/nsChromeRegistry.h b/chrome/src/nsChromeRegistry.h index 6322bdc5738d..d05d6bdf6621 100644 --- a/chrome/src/nsChromeRegistry.h +++ b/chrome/src/nsChromeRegistry.h @@ -32,7 +32,7 @@ class nsISimpleEnumerator; class nsSupportsHashtable; class nsIRDFContainer; class nsIRDFContainerUtils; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDocument; #include "nsIRDFCompositeDataSource.h" @@ -83,7 +83,7 @@ private: NS_IMETHOD GetProfileRoot(nsCString& aFileURL); NS_IMETHOD GetInstallRoot(nsCString& aFileURL); - NS_IMETHOD RefreshWindow(nsIDOMWindow* aWindow); + NS_IMETHOD RefreshWindow(nsIDOMWindowInternal* aWindow); NS_IMETHOD GetArcs(nsIRDFDataSource* aDataSource, const nsCString& aType, diff --git a/chrome/src/nsChromeUIDataSource.h b/chrome/src/nsChromeUIDataSource.h index 90832af3f6f6..cbb5172377bb 100644 --- a/chrome/src/nsChromeUIDataSource.h +++ b/chrome/src/nsChromeUIDataSource.h @@ -29,7 +29,7 @@ class nsICSSLoader; class nsISimpleEnumerator; class nsSupportsHashtable; class nsIRDFContainer; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDocument; #include "nsIRDFDataSource.h" diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 575d83ad51c9..a8a1f9839116 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -104,7 +104,7 @@ #include "nsIPrivateDOMImplementation.h" #include "nsIInterfaceRequestor.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMElement.h" #include "nsIAnonymousContentCreator.h" @@ -2409,7 +2409,7 @@ NS_IMETHODIMP nsDocument::GetLocation(jsval* aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->GetLocation(aLocation); } @@ -2421,7 +2421,7 @@ NS_IMETHODIMP nsDocument::SetLocation(jsval aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->SetLocation(aLocation); } @@ -2457,8 +2457,8 @@ nsDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); window->QueryInterface(NS_GET_IID(nsIDOMAbstractView), @@ -2497,8 +2497,8 @@ nsDocument::GetPlugins(nsIDOMPluginArray** aPlugins) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); nsCOMPtr navigator; diff --git a/content/base/src/nsDocumentViewer.cpp b/content/base/src/nsDocumentViewer.cpp index 2537fca190d8..e2d145a48591 100644 --- a/content/base/src/nsDocumentViewer.cpp +++ b/content/base/src/nsDocumentViewer.cpp @@ -27,7 +27,7 @@ #include "nsIContent.h" #include "nsIContentViewerContainer.h" #include "nsIDocumentViewer.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIImageGroup.h" #include "nsIImageObserver.h" @@ -1838,7 +1838,7 @@ NS_IMETHODIMP nsDocViwerSelectionListener::NotifySelectionChanged(nsIDOMDocument nsCOMPtr scriptGlobalObject; theDoc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); if (!domWindow) return NS_ERROR_FAILURE; domWindow->UpdateCommands(NS_ConvertToString("select")); diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index 74a6cc26ad04..4f5ef037e84e 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -36,7 +36,7 @@ #include "nsIScrollableView.h" #include "nsIDOMEventTarget.h" #include "nsIInterfaceRequestor.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMAbstractView.h" #include "prmem.h" #include "nsLayoutAtoms.h" @@ -296,8 +296,8 @@ nsDOMEvent::GetView(nsIDOMAbstractView** aView) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); window->QueryInterface(NS_GET_IID(nsIDOMAbstractView), (void **)aView); diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 718844a0300f..076485ad8a5b 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -53,7 +53,7 @@ #include "nsIScriptGlobalObject.h" #include "nsIPrivateDOMEvent.h" #include "nsIGfxTextControlFrame.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #include "nsIEnumerator.h" #include "nsFrameTraversal.h" @@ -342,7 +342,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, nsCOMPtr ourGlobal; gLastFocusedDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetRootCommandDispatcher(gLastFocusedDocument, getter_AddRefs(commandDispatcher)); @@ -406,7 +406,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, nsCOMPtr commandDispatcher; nsCOMPtr focusedElement; - nsCOMPtr focusedWindow; + nsCOMPtr focusedWindow; nsCOMPtr xulDoc = do_QueryInterface(mDocument); if (xulDoc) { @@ -432,7 +432,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, { nsCOMPtr privateWindow = do_QueryInterface(focusedWindow); if(privateWindow){ - nsCOMPtr privateRootWindow; + nsCOMPtr privateRootWindow; privateWindow->GetPrivateRoot(getter_AddRefs(privateRootWindow)); if(privateRootWindow) { nsCOMPtr privateParentDoc; @@ -508,7 +508,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, // focused sub-window and sub-element for this top-level // window. nsCOMPtr commandDispatcher; - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -780,14 +780,14 @@ nsEventStateManager::ChangeTextSize(PRInt32 change) { nsCOMPtr ourGlobal; gLastFocusedDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); NS_ENSURE_TRUE(ourWindow, NS_ERROR_FAILURE); ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE); - nsCOMPtr windowContent; + nsCOMPtr windowContent; rootWindow->Get_content(getter_AddRefs(windowContent)); NS_ENSURE_TRUE(windowContent, NS_ERROR_FAILURE); diff --git a/content/html/content/public/nsIFormSubmitObserver.h b/content/html/content/public/nsIFormSubmitObserver.h index 8b2b99f8788f..892c848b79ad 100644 --- a/content/html/content/public/nsIFormSubmitObserver.h +++ b/content/html/content/public/nsIFormSubmitObserver.h @@ -32,7 +32,7 @@ #include "nsISupports.h" #include "prtypes.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIURI.h" class nsString; @@ -55,7 +55,7 @@ public: * will be loaded in (form could have target attribute set) * @param actionURL- URL to which the form will be submitted. */ - NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindow* window, nsIURI* actionURL) = 0; + NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindowInternal* window, nsIURI* actionURL) = 0; }; diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp index 091d1c6ed99c..ac36c8207d9a 100644 --- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -37,7 +37,7 @@ #include "nsIJSNativeInitializer.h" #include "nsSize.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" @@ -649,7 +649,7 @@ nsHTMLImageElement::GetCallerSourceURL(JSContext* cx, nsCOMPtr global; nsLayoutUtils::GetDynamicScriptGlobal(cx, getter_AddRefs(global)); if (global) { - nsCOMPtr window = do_QueryInterface(global); + nsCOMPtr window = do_QueryInterface(global); if (window) { nsCOMPtr domDoc; @@ -763,7 +763,7 @@ nsHTMLImageElement::Initialize(JSContext* aContext, nsLayoutUtils::GetStaticScriptGlobal(aContext, aObj, getter_AddRefs(globalObject));; if (globalObject) { - nsIDOMWindow* domWindow; + nsIDOMWindowInternal* domWindow; result = globalObject->QueryInterface(kIDOMWindowIID, (void**)&domWindow); if (NS_SUCCEEDED(result)) { nsIDOMDocument* domDocument; diff --git a/content/html/content/src/nsHTMLSpacerElement.cpp b/content/html/content/src/nsHTMLSpacerElement.cpp index e0d264e965e0..18a6b8e19340 100644 --- a/content/html/content/src/nsHTMLSpacerElement.cpp +++ b/content/html/content/src/nsHTMLSpacerElement.cpp @@ -35,7 +35,7 @@ #include "nsIJSScriptObject.h" #include "nsSize.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 5e261f8d202b..468f61c3fa45 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -46,7 +46,7 @@ #include "nsIDOMComment.h" #include "nsIDOMDOMImplementation.h" #include "nsIDOMDocumentType.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMHTMLFormElement.h" #include "nsIStreamListener.h" #include "nsIURL.h" @@ -2007,7 +2007,7 @@ nsHTMLDocument::GetSourceDocumentURL(JSContext* cx, nsCOMPtr global; nsLayoutUtils::GetDynamicScriptGlobal(cx, getter_AddRefs(global)); if (global) { - nsCOMPtr window(do_QueryInterface(global, &result)); + nsCOMPtr window(do_QueryInterface(global, &result)); if (window) { nsCOMPtr document; diff --git a/content/xul/content/src/nsXULPopupListener.cpp b/content/xul/content/src/nsXULPopupListener.cpp index d62192a81017..77527697a19b 100644 --- a/content/xul/content/src/nsXULPopupListener.cpp +++ b/content/xul/content/src/nsXULPopupListener.cpp @@ -42,7 +42,7 @@ #include "nsRDFCID.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULDocument.h" #include "nsIDocument.h" #include "nsIContent.h" @@ -645,7 +645,7 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) if (global) { if (NS_OK == global->GetContext(getter_AddRefs(context))) { // Get the DOM window - nsCOMPtr domWindow = do_QueryInterface(global); + nsCOMPtr domWindow = do_QueryInterface(global); if (domWindow != nsnull) { // Find out if we're anchored. nsAutoString anchorAlignment; anchorAlignment.AssignWithConversion("none"); diff --git a/content/xul/document/src/nsXULCommandDispatcher.cpp b/content/xul/document/src/nsXULCommandDispatcher.cpp index af6d011185f8..19d4f7766a51 100644 --- a/content/xul/document/src/nsXULCommandDispatcher.cpp +++ b/content/xul/document/src/nsXULCommandDispatcher.cpp @@ -37,7 +37,7 @@ #include "nsIDOMNSHTMLInputElement.h" #include "nsIDOMNSHTMLTextAreaElement.h" #include "nsIDOMUIEvent.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULElement.h" #include "nsIDocument.h" #include "nsIPresContext.h" @@ -134,7 +134,7 @@ nsXULCommandDispatcher::GetFocusedElement(nsIDOMElement** aElement) } NS_IMETHODIMP -nsXULCommandDispatcher::GetFocusedWindow(nsIDOMWindow** aWindow) +nsXULCommandDispatcher::GetFocusedWindow(nsIDOMWindowInternal** aWindow) { *aWindow = mCurrentWindow; NS_IF_ADDREF(*aWindow); @@ -153,7 +153,7 @@ nsXULCommandDispatcher::SetFocusedElement(nsIDOMElement* aElement) } NS_IMETHODIMP -nsXULCommandDispatcher::SetFocusedWindow(nsIDOMWindow* aWindow) +nsXULCommandDispatcher::SetFocusedWindow(nsIDOMWindowInternal* aWindow) { mCurrentWindow = aWindow; return NS_OK; @@ -350,7 +350,7 @@ nsXULCommandDispatcher::GetControllers(nsIControllers** aResult) return htmlInputElement->GetControllers(aResult); } else if (mCurrentWindow) { - nsCOMPtr domWindow = do_QueryInterface(mCurrentWindow); + nsCOMPtr domWindow = do_QueryInterface(mCurrentWindow); if (domWindow) return domWindow->GetControllers(aResult); } @@ -398,7 +398,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) // but we don't hear the subsequent focus to the Ender window. nsCOMPtr ownerDoc; domElement->GetOwnerDocument(getter_AddRefs(ownerDoc)); - nsCOMPtr domWindow; + nsCOMPtr domWindow; GetParentWindowFromDocument(ownerDoc, getter_AddRefs(domWindow)); if (domWindow) SetFocusedWindow(domWindow); @@ -406,7 +406,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) else { // We're focusing a window. We only want to do an update commands // if no element is focused. - nsCOMPtr domWindow; + nsCOMPtr domWindow; nsCOMPtr domDoc = do_QueryInterface(t); if (domDoc) { GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); @@ -463,7 +463,7 @@ nsXULCommandDispatcher::Blur(nsIDOMEvent* aEvent) SetFocusedElement(nsnull); } - nsCOMPtr domWindow; + nsCOMPtr domWindow; nsCOMPtr domDoc = do_QueryInterface(t); if (domDoc) { GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); @@ -530,7 +530,7 @@ nsXULCommandDispatcher::Matches(const nsString& aList, nsresult -nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, nsIDOMWindow** aWindow) +nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, nsIDOMWindowInternal** aWindow) { nsCOMPtr objectOwner = do_QueryInterface(aDocument); if(!objectOwner) return NS_OK; @@ -539,7 +539,7 @@ nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, n objectOwner->GetScriptGlobalObject(getter_AddRefs(globalObject)); if(!globalObject) return NS_OK; - nsCOMPtr domWindow = do_QueryInterface(globalObject); + nsCOMPtr domWindow = do_QueryInterface(globalObject); *aWindow = domWindow; NS_IF_ADDREF(*aWindow); return NS_OK; @@ -568,7 +568,7 @@ nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aComman // Move up to the window. nsCOMPtr domDoc; mCurrentElement->GetOwnerDocument(getter_AddRefs(domDoc)); - nsCOMPtr domWindow; + nsCOMPtr domWindow; GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); currentWindow = do_QueryInterface(domWindow); } @@ -579,7 +579,7 @@ nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aComman else return NS_OK; while(currentWindow) { - nsCOMPtr domWindow = do_QueryInterface(currentWindow); + nsCOMPtr domWindow = do_QueryInterface(currentWindow); if(domWindow) { nsCOMPtr controllers2; domWindow->GetControllers(getter_AddRefs(controllers2)); diff --git a/content/xul/document/src/nsXULCommandDispatcher.h b/content/xul/document/src/nsXULCommandDispatcher.h index 3758d3d1cfab..a07422cfef50 100644 --- a/content/xul/document/src/nsXULCommandDispatcher.h +++ b/content/xul/document/src/nsXULCommandDispatcher.h @@ -76,7 +76,7 @@ public: NS_IMETHOD SetScriptObject(void *aScriptObject); public: - static nsresult GetParentWindowFromDocument(nsIDOMDocument* aElement, nsIDOMWindow** aWindow); + static nsresult GetParentWindowFromDocument(nsIDOMDocument* aElement, nsIDOMWindowInternal** aWindow); protected: void* mScriptObject; // ???? @@ -85,7 +85,7 @@ protected: // waiting to happen! If somebody deletes the node, then asks us // for the focus, we'll get killed! nsCOMPtr mCurrentElement; // [OWNER] - nsCOMPtr mCurrentWindow; // [OWNER] + nsCOMPtr mCurrentWindow; // [OWNER] PRBool mSuppressFocus; PRBool mSuppressFocusScroll; diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index d1db848dff33..cc77f87b5f71 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -115,7 +115,7 @@ #include "nsRDFCID.h" #include "nsRDFDOMNodeList.h" #include "nsXPIDLString.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsXULCommandDispatcher.h" #include "nsXULDocument.h" #include "nsXULElement.h" @@ -2798,8 +2798,8 @@ nsXULDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); window->QueryInterface(NS_GET_IID(nsIDOMAbstractView), @@ -2999,7 +2999,7 @@ NS_IMETHODIMP nsXULDocument::GetLocation(jsval* aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->GetLocation(aLocation); } @@ -3011,7 +3011,7 @@ NS_IMETHODIMP nsXULDocument::SetLocation(jsval aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->SetLocation(aLocation); } diff --git a/content/xul/document/src/nsXULPrototypeDocument.cpp b/content/xul/document/src/nsXULPrototypeDocument.cpp index 0786f25a7f0d..f9c357c8e6a1 100644 --- a/content/xul/document/src/nsXULPrototypeDocument.cpp +++ b/content/xul/document/src/nsXULPrototypeDocument.cpp @@ -67,7 +67,7 @@ public: NS_IMETHOD SetNewDocument(nsIDOMDocument *aDocument); NS_IMETHOD SetDocShell(nsIDocShell *aDocShell); NS_IMETHOD GetDocShell(nsIDocShell **aDocShell); - NS_IMETHOD SetOpenerWindow(nsIDOMWindow *aOpener); + NS_IMETHOD SetOpenerWindow(nsIDOMWindowInternal *aOpener); NS_IMETHOD SetGlobalObjectOwner(nsIScriptGlobalObjectOwner* aOwner); NS_IMETHOD GetGlobalObjectOwner(nsIScriptGlobalObjectOwner** aOwner); NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, @@ -526,7 +526,7 @@ nsXULPDGlobalObject::GetDocShell(nsIDocShell **aDocShell) NS_IMETHODIMP -nsXULPDGlobalObject::SetOpenerWindow(nsIDOMWindow *aOpener) +nsXULPDGlobalObject::SetOpenerWindow(nsIDOMWindowInternal *aOpener) { NS_NOTREACHED("waaah!"); return NS_ERROR_UNEXPECTED; diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 0e11389ca006..152836e20230 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -37,7 +37,7 @@ #include "nsIMarkupDocumentViewer.h" #include "nsXPIDLString.h" #include "nsIChromeEventHandler.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIWebBrowserChrome.h" #include "nsPoint.h" #include "nsGfxCIID.h" @@ -175,6 +175,13 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID& aIID, void** aSink) { *aSink = mScriptGlobal; } + else if(aIID.Equals(NS_GET_IID(nsIDOMWindowInternal)) && + NS_SUCCEEDED(EnsureScriptEnvironment())) + { + NS_ENSURE_SUCCESS(mScriptGlobal->QueryInterface(NS_GET_IID(nsIDOMWindowInternal), + aSink), NS_ERROR_FAILURE); + return NS_OK; + } else if(aIID.Equals(NS_GET_IID(nsIDOMWindow)) && NS_SUCCEEDED(EnsureScriptEnvironment())) { @@ -3055,7 +3062,7 @@ NS_IMETHODIMP nsDocShell::GetCurrentDocumentOwner(nsISupports** aOwner) nsCOMPtr parentItem; rv = GetSameTypeParent(getter_AddRefs(parentItem)); if (NS_FAILED(rv) || !parentItem) return rv; - nsCOMPtr parentWindow(do_GetInterface(parentItem)); + nsCOMPtr parentWindow(do_GetInterface(parentItem)); if (!parentWindow) return NS_OK; nsCOMPtr parentDomDoc; rv = parentWindow->GetDocument(getter_AddRefs(parentDomDoc)); diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index b9f08cc70bc6..a0dbdd6885ac 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -105,7 +105,7 @@ typedef unsigned long HMTX; #include "nsIDocShellTreeNode.h" #include "nsIDocShellTreeOwner.h" #include "nsCURILoader.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsEscape.h" #include "nsIPlatformCharset.h" #include "nsICharsetConverterManager.h" @@ -365,6 +365,13 @@ nsWebShell::GetInterface(const nsIID &aIID, void** aInstancePtr) NS_ADDREF((nsISupports*)*aInstancePtr); return NS_OK; } + else if(aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) + { + NS_ENSURE_SUCCESS(EnsureScriptEnvironment(), NS_ERROR_FAILURE); + NS_ENSURE_SUCCESS(mScriptGlobal->QueryInterface(NS_GET_IID(nsIDOMWindowInternal), + aInstancePtr), NS_ERROR_FAILURE); + return NS_OK; + } else if(aIID.Equals(NS_GET_IID(nsIDOMWindow))) { NS_ENSURE_SUCCESS(EnsureScriptEnvironment(), NS_ERROR_FAILURE); diff --git a/dom/public/base/MANIFEST b/dom/public/base/MANIFEST index 097d686027df..59fcf451c4ee 100644 --- a/dom/public/base/MANIFEST +++ b/dom/public/base/MANIFEST @@ -21,6 +21,7 @@ # nsIDOMWindow.h +nsIDOMWindowInternal.h nsIDOMLocation.h nsIDOMNSLocation.h nsIDOMNavigator.h diff --git a/dom/public/base/Makefile.in b/dom/public/base/Makefile.in index 19fbc4ac1a00..ec2bc1db5064 100644 --- a/dom/public/base/Makefile.in +++ b/dom/public/base/Makefile.in @@ -30,6 +30,7 @@ MODULE = dom EXPORTS = \ nsIDOMWindow.h \ + nsIDOMWindowInternal.h \ nsIDOMNavigator.h \ nsIDOMLocation.h \ nsIDOMNSLocation.h \ diff --git a/dom/public/base/makefile.win b/dom/public/base/makefile.win index 03a3a57a8d0f..9092bc4f5b76 100644 --- a/dom/public/base/makefile.win +++ b/dom/public/base/makefile.win @@ -23,7 +23,8 @@ DEPTH=..\..\.. DEFINES=-D_IMPL_NS_DOM -EXPORTS=nsIDOMWindow.h nsIDOMNavigator.h nsIDOMLocation.h nsIDOMNSLocation.h \ +EXPORTS=nsIDOMWindow.h nsIDOMWindowInternal.h nsIDOMNavigator.h \ + nsIDOMLocation.h nsIDOMNSLocation.h \ nsIDOMWindowCollection.h nsIDOMScreen.h nsIDOMHistory.h \ nsIDOMMimeType.h nsIDOMMimeTypeArray.h \ nsIDOMPlugin.h nsIDOMPluginArray.h nsIDOMBarProp.h \ diff --git a/dom/public/base/nsIDOMWindow.h b/dom/public/base/nsIDOMWindow.h index 1eb0eb7c4a28..d12fa62ead49 100644 --- a/dom/public/base/nsIDOMWindow.h +++ b/dom/public/base/nsIDOMWindow.h @@ -27,22 +27,12 @@ #include "nsISupports.h" #include "nsString.h" #include "nsIScriptContext.h" -#include "jsapi.h" -class nsIDOMNavigator; -class nsIPrompt; class nsIDOMDocument; class nsIDOMSelection; class nsIDOMBarProp; -class nsIDOMScreen; -class nsIDOMHistory; class nsIDOMWindowCollection; -class nsIDOMEvent; -class nsISidebar; -class nsIDOMPkcs11; -class nsIDOMCrypto; class nsIDOMWindow; -class nsIControllers; #define NS_IDOMWINDOW_IID \ { 0xa6cf906b, 0x15b3, 0x11d2, \ @@ -52,366 +42,59 @@ class nsIDOMWindow : public nsISupports { public: static const nsIID& GetIID() { static nsIID iid = NS_IDOMWINDOW_IID; return iid; } - NS_IMETHOD GetWindow(nsIDOMWindow** aWindow)=0; - - NS_IMETHOD GetSelf(nsIDOMWindow** aSelf)=0; - NS_IMETHOD GetDocument(nsIDOMDocument** aDocument)=0; - NS_IMETHOD GetNavigator(nsIDOMNavigator** aNavigator)=0; - - NS_IMETHOD GetScreen(nsIDOMScreen** aScreen)=0; - - NS_IMETHOD GetHistory(nsIDOMHistory** aHistory)=0; - NS_IMETHOD GetParent(nsIDOMWindow** aParent)=0; NS_IMETHOD GetTop(nsIDOMWindow** aTop)=0; - NS_IMETHOD Get_content(nsIDOMWindow** a_content)=0; - - NS_IMETHOD GetSidebar(nsISidebar** aSidebar)=0; - - NS_IMETHOD GetPrompter(nsIPrompt** aPrompter)=0; - - NS_IMETHOD GetMenubar(nsIDOMBarProp** aMenubar)=0; - - NS_IMETHOD GetToolbar(nsIDOMBarProp** aToolbar)=0; - - NS_IMETHOD GetLocationbar(nsIDOMBarProp** aLocationbar)=0; - - NS_IMETHOD GetPersonalbar(nsIDOMBarProp** aPersonalbar)=0; - - NS_IMETHOD GetStatusbar(nsIDOMBarProp** aStatusbar)=0; - NS_IMETHOD GetScrollbars(nsIDOMBarProp** aScrollbars)=0; - NS_IMETHOD GetDirectories(nsIDOMBarProp** aDirectories)=0; - - NS_IMETHOD GetClosed(PRBool* aClosed)=0; - NS_IMETHOD GetFrames(nsIDOMWindowCollection** aFrames)=0; - NS_IMETHOD GetCrypto(nsIDOMCrypto** aCrypto)=0; - - NS_IMETHOD GetPkcs11(nsIDOMPkcs11** aPkcs11)=0; - - NS_IMETHOD GetControllers(nsIControllers** aControllers)=0; - - NS_IMETHOD GetOpener(nsIDOMWindow** aOpener)=0; - NS_IMETHOD SetOpener(nsIDOMWindow* aOpener)=0; - - NS_IMETHOD GetStatus(nsAWritableString& aStatus)=0; - NS_IMETHOD SetStatus(const nsAReadableString& aStatus)=0; - - NS_IMETHOD GetDefaultStatus(nsAWritableString& aDefaultStatus)=0; - NS_IMETHOD SetDefaultStatus(const nsAReadableString& aDefaultStatus)=0; - NS_IMETHOD GetName(nsAWritableString& aName)=0; NS_IMETHOD SetName(const nsAReadableString& aName)=0; - NS_IMETHOD GetLocation(jsval* aLocation)=0; - NS_IMETHOD SetLocation(jsval aLocation)=0; - - NS_IMETHOD GetTitle(nsAWritableString& aTitle)=0; - NS_IMETHOD SetTitle(const nsAReadableString& aTitle)=0; - - NS_IMETHOD GetInnerWidth(PRInt32* aInnerWidth)=0; - NS_IMETHOD SetInnerWidth(PRInt32 aInnerWidth)=0; - - NS_IMETHOD GetInnerHeight(PRInt32* aInnerHeight)=0; - NS_IMETHOD SetInnerHeight(PRInt32 aInnerHeight)=0; - - NS_IMETHOD GetOuterWidth(PRInt32* aOuterWidth)=0; - NS_IMETHOD SetOuterWidth(PRInt32 aOuterWidth)=0; - - NS_IMETHOD GetOuterHeight(PRInt32* aOuterHeight)=0; - NS_IMETHOD SetOuterHeight(PRInt32 aOuterHeight)=0; - - NS_IMETHOD GetScreenX(PRInt32* aScreenX)=0; - NS_IMETHOD SetScreenX(PRInt32 aScreenX)=0; - - NS_IMETHOD GetScreenY(PRInt32* aScreenY)=0; - NS_IMETHOD SetScreenY(PRInt32 aScreenY)=0; - - NS_IMETHOD GetPageXOffset(PRInt32* aPageXOffset)=0; - NS_IMETHOD SetPageXOffset(PRInt32 aPageXOffset)=0; - - NS_IMETHOD GetPageYOffset(PRInt32* aPageYOffset)=0; - NS_IMETHOD SetPageYOffset(PRInt32 aPageYOffset)=0; - NS_IMETHOD GetScrollX(PRInt32* aScrollX)=0; NS_IMETHOD GetScrollY(PRInt32* aScrollY)=0; - NS_IMETHOD GetLength(PRUint32* aLength)=0; - - NS_IMETHOD Dump(const nsAReadableString& aStr)=0; - - NS_IMETHOD Alert(JSContext* cx, jsval* argv, PRUint32 argc)=0; - - NS_IMETHOD Confirm(JSContext* cx, jsval* argv, PRUint32 argc, PRBool* aReturn)=0; - - NS_IMETHOD Prompt(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn)=0; - - NS_IMETHOD Focus()=0; - - NS_IMETHOD Blur()=0; - - NS_IMETHOD Back()=0; - - NS_IMETHOD Forward()=0; - - NS_IMETHOD Home()=0; - - NS_IMETHOD Stop()=0; - - NS_IMETHOD Print()=0; - - NS_IMETHOD MoveTo(PRInt32 aXPos, PRInt32 aYPos)=0; - - NS_IMETHOD MoveBy(PRInt32 aXDif, PRInt32 aYDif)=0; - - NS_IMETHOD ResizeTo(PRInt32 aWidth, PRInt32 aHeight)=0; - - NS_IMETHOD ResizeBy(PRInt32 aWidthDif, PRInt32 aHeightDif)=0; - - NS_IMETHOD SizeToContent()=0; - - NS_IMETHOD GetAttention()=0; - - NS_IMETHOD Scroll(PRInt32 aXScroll, PRInt32 aYScroll)=0; - NS_IMETHOD ScrollTo(PRInt32 aXScroll, PRInt32 aYScroll)=0; NS_IMETHOD ScrollBy(PRInt32 aXScrollDif, PRInt32 aYScrollDif)=0; - NS_IMETHOD ClearTimeout(PRInt32 aTimerID)=0; - - NS_IMETHOD ClearInterval(PRInt32 aTimerID)=0; - - NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn)=0; - - NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn)=0; - - NS_IMETHOD CaptureEvents(PRInt32 aEventFlags)=0; - - NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags)=0; - - NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt)=0; - - NS_IMETHOD EnableExternalCapture()=0; - - NS_IMETHOD DisableExternalCapture()=0; - - NS_IMETHOD SetCursor(const nsAReadableString& aCursor)=0; - - NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0; - - NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn)=0; - - NS_IMETHOD Close()=0; - - NS_IMETHOD Close(JSContext* cx, jsval* argv, PRUint32 argc)=0; - - NS_IMETHOD UpdateCommands(const nsAReadableString& aAction)=0; - - NS_IMETHOD Escape(const nsAReadableString& aStr, nsAWritableString& aReturn)=0; - - NS_IMETHOD Unescape(const nsAReadableString& aStr, nsAWritableString& aReturn)=0; - NS_IMETHOD GetSelection(nsIDOMSelection** aReturn)=0; }; #define NS_DECL_IDOMWINDOW \ - NS_IMETHOD GetWindow(nsIDOMWindow** aWindow); \ - NS_IMETHOD GetSelf(nsIDOMWindow** aSelf); \ NS_IMETHOD GetDocument(nsIDOMDocument** aDocument); \ - NS_IMETHOD GetNavigator(nsIDOMNavigator** aNavigator); \ - NS_IMETHOD GetScreen(nsIDOMScreen** aScreen); \ - NS_IMETHOD GetHistory(nsIDOMHistory** aHistory); \ NS_IMETHOD GetParent(nsIDOMWindow** aParent); \ NS_IMETHOD GetTop(nsIDOMWindow** aTop); \ - NS_IMETHOD Get_content(nsIDOMWindow** a_content); \ - NS_IMETHOD GetSidebar(nsISidebar** aSidebar); \ - NS_IMETHOD GetPrompter(nsIPrompt** aPrompter); \ - NS_IMETHOD GetMenubar(nsIDOMBarProp** aMenubar); \ - NS_IMETHOD GetToolbar(nsIDOMBarProp** aToolbar); \ - NS_IMETHOD GetLocationbar(nsIDOMBarProp** aLocationbar); \ - NS_IMETHOD GetPersonalbar(nsIDOMBarProp** aPersonalbar); \ - NS_IMETHOD GetStatusbar(nsIDOMBarProp** aStatusbar); \ NS_IMETHOD GetScrollbars(nsIDOMBarProp** aScrollbars); \ - NS_IMETHOD GetDirectories(nsIDOMBarProp** aDirectories); \ - NS_IMETHOD GetClosed(PRBool* aClosed); \ NS_IMETHOD GetFrames(nsIDOMWindowCollection** aFrames); \ - NS_IMETHOD GetCrypto(nsIDOMCrypto** aCrypto); \ - NS_IMETHOD GetPkcs11(nsIDOMPkcs11** aPkcs11); \ - NS_IMETHOD GetControllers(nsIControllers** aControllers); \ - NS_IMETHOD GetOpener(nsIDOMWindow** aOpener); \ - NS_IMETHOD SetOpener(nsIDOMWindow* aOpener); \ - NS_IMETHOD GetStatus(nsAWritableString& aStatus); \ - NS_IMETHOD SetStatus(const nsAReadableString& aStatus); \ - NS_IMETHOD GetDefaultStatus(nsAWritableString& aDefaultStatus); \ - NS_IMETHOD SetDefaultStatus(const nsAReadableString& aDefaultStatus); \ NS_IMETHOD GetName(nsAWritableString& aName); \ NS_IMETHOD SetName(const nsAReadableString& aName); \ - NS_IMETHOD GetLocation(jsval* aLocation); \ - NS_IMETHOD SetLocation(jsval aLocation); \ - NS_IMETHOD GetTitle(nsAWritableString& aTitle); \ - NS_IMETHOD SetTitle(const nsAReadableString& aTitle); \ - NS_IMETHOD GetInnerWidth(PRInt32* aInnerWidth); \ - NS_IMETHOD SetInnerWidth(PRInt32 aInnerWidth); \ - NS_IMETHOD GetInnerHeight(PRInt32* aInnerHeight); \ - NS_IMETHOD SetInnerHeight(PRInt32 aInnerHeight); \ - NS_IMETHOD GetOuterWidth(PRInt32* aOuterWidth); \ - NS_IMETHOD SetOuterWidth(PRInt32 aOuterWidth); \ - NS_IMETHOD GetOuterHeight(PRInt32* aOuterHeight); \ - NS_IMETHOD SetOuterHeight(PRInt32 aOuterHeight); \ - NS_IMETHOD GetScreenX(PRInt32* aScreenX); \ - NS_IMETHOD SetScreenX(PRInt32 aScreenX); \ - NS_IMETHOD GetScreenY(PRInt32* aScreenY); \ - NS_IMETHOD SetScreenY(PRInt32 aScreenY); \ - NS_IMETHOD GetPageXOffset(PRInt32* aPageXOffset); \ - NS_IMETHOD SetPageXOffset(PRInt32 aPageXOffset); \ - NS_IMETHOD GetPageYOffset(PRInt32* aPageYOffset); \ - NS_IMETHOD SetPageYOffset(PRInt32 aPageYOffset); \ NS_IMETHOD GetScrollX(PRInt32* aScrollX); \ NS_IMETHOD GetScrollY(PRInt32* aScrollY); \ - NS_IMETHOD GetLength(PRUint32* aLength); \ - NS_IMETHOD Dump(const nsAReadableString& aStr); \ - NS_IMETHOD Alert(JSContext* cx, jsval* argv, PRUint32 argc); \ - NS_IMETHOD Confirm(JSContext* cx, jsval* argv, PRUint32 argc, PRBool* aReturn); \ - NS_IMETHOD Prompt(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn); \ - NS_IMETHOD Focus(); \ - NS_IMETHOD Blur(); \ - NS_IMETHOD Back(); \ - NS_IMETHOD Forward(); \ - NS_IMETHOD Home(); \ - NS_IMETHOD Stop(); \ - NS_IMETHOD Print(); \ - NS_IMETHOD MoveTo(PRInt32 aXPos, PRInt32 aYPos); \ - NS_IMETHOD MoveBy(PRInt32 aXDif, PRInt32 aYDif); \ - NS_IMETHOD ResizeTo(PRInt32 aWidth, PRInt32 aHeight); \ - NS_IMETHOD ResizeBy(PRInt32 aWidthDif, PRInt32 aHeightDif); \ - NS_IMETHOD SizeToContent(); \ - NS_IMETHOD GetAttention(); \ - NS_IMETHOD Scroll(PRInt32 aXScroll, PRInt32 aYScroll); \ NS_IMETHOD ScrollTo(PRInt32 aXScroll, PRInt32 aYScroll); \ NS_IMETHOD ScrollBy(PRInt32 aXScrollDif, PRInt32 aYScrollDif); \ - NS_IMETHOD ClearTimeout(PRInt32 aTimerID); \ - NS_IMETHOD ClearInterval(PRInt32 aTimerID); \ - NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn); \ - NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn); \ - NS_IMETHOD CaptureEvents(PRInt32 aEventFlags); \ - NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags); \ - NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt); \ - NS_IMETHOD EnableExternalCapture(); \ - NS_IMETHOD DisableExternalCapture(); \ - NS_IMETHOD SetCursor(const nsAReadableString& aCursor); \ - NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \ - NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn); \ - NS_IMETHOD Close(); \ - NS_IMETHOD Close(JSContext* cx, jsval* argv, PRUint32 argc); \ - NS_IMETHOD UpdateCommands(const nsAReadableString& aAction); \ - NS_IMETHOD Escape(const nsAReadableString& aStr, nsAWritableString& aReturn); \ - NS_IMETHOD Unescape(const nsAReadableString& aStr, nsAWritableString& aReturn); \ NS_IMETHOD GetSelection(nsIDOMSelection** aReturn); \ #define NS_FORWARD_IDOMWINDOW(_to) \ - NS_IMETHOD GetWindow(nsIDOMWindow** aWindow) { return _to GetWindow(aWindow); } \ - NS_IMETHOD GetSelf(nsIDOMWindow** aSelf) { return _to GetSelf(aSelf); } \ NS_IMETHOD GetDocument(nsIDOMDocument** aDocument) { return _to GetDocument(aDocument); } \ - NS_IMETHOD GetNavigator(nsIDOMNavigator** aNavigator) { return _to GetNavigator(aNavigator); } \ - NS_IMETHOD GetScreen(nsIDOMScreen** aScreen) { return _to GetScreen(aScreen); } \ - NS_IMETHOD GetHistory(nsIDOMHistory** aHistory) { return _to GetHistory(aHistory); } \ NS_IMETHOD GetParent(nsIDOMWindow** aParent) { return _to GetParent(aParent); } \ NS_IMETHOD GetTop(nsIDOMWindow** aTop) { return _to GetTop(aTop); } \ - NS_IMETHOD Get_content(nsIDOMWindow** a_content) { return _to Get_content(a_content); } \ - NS_IMETHOD GetSidebar(nsISidebar** aSidebar) { return _to GetSidebar(aSidebar); } \ - NS_IMETHOD GetPrompter(nsIPrompt** aPrompter) { return _to GetPrompter(aPrompter); } \ - NS_IMETHOD GetMenubar(nsIDOMBarProp** aMenubar) { return _to GetMenubar(aMenubar); } \ - NS_IMETHOD GetToolbar(nsIDOMBarProp** aToolbar) { return _to GetToolbar(aToolbar); } \ - NS_IMETHOD GetLocationbar(nsIDOMBarProp** aLocationbar) { return _to GetLocationbar(aLocationbar); } \ - NS_IMETHOD GetPersonalbar(nsIDOMBarProp** aPersonalbar) { return _to GetPersonalbar(aPersonalbar); } \ - NS_IMETHOD GetStatusbar(nsIDOMBarProp** aStatusbar) { return _to GetStatusbar(aStatusbar); } \ NS_IMETHOD GetScrollbars(nsIDOMBarProp** aScrollbars) { return _to GetScrollbars(aScrollbars); } \ - NS_IMETHOD GetDirectories(nsIDOMBarProp** aDirectories) { return _to GetDirectories(aDirectories); } \ - NS_IMETHOD GetClosed(PRBool* aClosed) { return _to GetClosed(aClosed); } \ NS_IMETHOD GetFrames(nsIDOMWindowCollection** aFrames) { return _to GetFrames(aFrames); } \ - NS_IMETHOD GetCrypto(nsIDOMCrypto** aCrypto) { return _to GetCrypto(aCrypto); } \ - NS_IMETHOD GetPkcs11(nsIDOMPkcs11** aPkcs11) { return _to GetPkcs11(aPkcs11); } \ - NS_IMETHOD GetControllers(nsIControllers** aControllers) { return _to GetControllers(aControllers); } \ - NS_IMETHOD GetOpener(nsIDOMWindow** aOpener) { return _to GetOpener(aOpener); } \ - NS_IMETHOD SetOpener(nsIDOMWindow* aOpener) { return _to SetOpener(aOpener); } \ - NS_IMETHOD GetStatus(nsAWritableString& aStatus) { return _to GetStatus(aStatus); } \ - NS_IMETHOD SetStatus(const nsAReadableString& aStatus) { return _to SetStatus(aStatus); } \ - NS_IMETHOD GetDefaultStatus(nsAWritableString& aDefaultStatus) { return _to GetDefaultStatus(aDefaultStatus); } \ - NS_IMETHOD SetDefaultStatus(const nsAReadableString& aDefaultStatus) { return _to SetDefaultStatus(aDefaultStatus); } \ NS_IMETHOD GetName(nsAWritableString& aName) { return _to GetName(aName); } \ NS_IMETHOD SetName(const nsAReadableString& aName) { return _to SetName(aName); } \ - NS_IMETHOD GetLocation(jsval* aLocation) { return _to GetLocation(aLocation); } \ - NS_IMETHOD SetLocation(jsval aLocation) { return _to SetLocation(aLocation); } \ - NS_IMETHOD GetTitle(nsAWritableString& aTitle) { return _to GetTitle(aTitle); } \ - NS_IMETHOD SetTitle(const nsAReadableString& aTitle) { return _to SetTitle(aTitle); } \ - NS_IMETHOD GetInnerWidth(PRInt32* aInnerWidth) { return _to GetInnerWidth(aInnerWidth); } \ - NS_IMETHOD SetInnerWidth(PRInt32 aInnerWidth) { return _to SetInnerWidth(aInnerWidth); } \ - NS_IMETHOD GetInnerHeight(PRInt32* aInnerHeight) { return _to GetInnerHeight(aInnerHeight); } \ - NS_IMETHOD SetInnerHeight(PRInt32 aInnerHeight) { return _to SetInnerHeight(aInnerHeight); } \ - NS_IMETHOD GetOuterWidth(PRInt32* aOuterWidth) { return _to GetOuterWidth(aOuterWidth); } \ - NS_IMETHOD SetOuterWidth(PRInt32 aOuterWidth) { return _to SetOuterWidth(aOuterWidth); } \ - NS_IMETHOD GetOuterHeight(PRInt32* aOuterHeight) { return _to GetOuterHeight(aOuterHeight); } \ - NS_IMETHOD SetOuterHeight(PRInt32 aOuterHeight) { return _to SetOuterHeight(aOuterHeight); } \ - NS_IMETHOD GetScreenX(PRInt32* aScreenX) { return _to GetScreenX(aScreenX); } \ - NS_IMETHOD SetScreenX(PRInt32 aScreenX) { return _to SetScreenX(aScreenX); } \ - NS_IMETHOD GetScreenY(PRInt32* aScreenY) { return _to GetScreenY(aScreenY); } \ - NS_IMETHOD SetScreenY(PRInt32 aScreenY) { return _to SetScreenY(aScreenY); } \ - NS_IMETHOD GetPageXOffset(PRInt32* aPageXOffset) { return _to GetPageXOffset(aPageXOffset); } \ - NS_IMETHOD SetPageXOffset(PRInt32 aPageXOffset) { return _to SetPageXOffset(aPageXOffset); } \ - NS_IMETHOD GetPageYOffset(PRInt32* aPageYOffset) { return _to GetPageYOffset(aPageYOffset); } \ - NS_IMETHOD SetPageYOffset(PRInt32 aPageYOffset) { return _to SetPageYOffset(aPageYOffset); } \ NS_IMETHOD GetScrollX(PRInt32* aScrollX) { return _to GetScrollX(aScrollX); } \ NS_IMETHOD GetScrollY(PRInt32* aScrollY) { return _to GetScrollY(aScrollY); } \ - NS_IMETHOD GetLength(PRUint32* aLength) { return _to GetLength(aLength); } \ - NS_IMETHOD Dump(const nsAReadableString& aStr) { return _to Dump(aStr); } \ - NS_IMETHOD Alert(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Alert(cx, argv, argc); } \ - NS_IMETHOD Confirm(JSContext* cx, jsval* argv, PRUint32 argc, PRBool* aReturn) { return _to Confirm(cx, argv, argc, aReturn); } \ - NS_IMETHOD Prompt(JSContext* cx, jsval* argv, PRUint32 argc, jsval* aReturn) { return _to Prompt(cx, argv, argc, aReturn); } \ - NS_IMETHOD Focus() { return _to Focus(); } \ - NS_IMETHOD Blur() { return _to Blur(); } \ - NS_IMETHOD Back() { return _to Back(); } \ - NS_IMETHOD Forward() { return _to Forward(); } \ - NS_IMETHOD Home() { return _to Home(); } \ - NS_IMETHOD Stop() { return _to Stop(); } \ - NS_IMETHOD Print() { return _to Print(); } \ - NS_IMETHOD MoveTo(PRInt32 aXPos, PRInt32 aYPos) { return _to MoveTo(aXPos, aYPos); } \ - NS_IMETHOD MoveBy(PRInt32 aXDif, PRInt32 aYDif) { return _to MoveBy(aXDif, aYDif); } \ - NS_IMETHOD ResizeTo(PRInt32 aWidth, PRInt32 aHeight) { return _to ResizeTo(aWidth, aHeight); } \ - NS_IMETHOD ResizeBy(PRInt32 aWidthDif, PRInt32 aHeightDif) { return _to ResizeBy(aWidthDif, aHeightDif); } \ - NS_IMETHOD SizeToContent() { return _to SizeToContent(); } \ - NS_IMETHOD GetAttention() { return _to GetAttention(); } \ - NS_IMETHOD Scroll(PRInt32 aXScroll, PRInt32 aYScroll) { return _to Scroll(aXScroll, aYScroll); } \ NS_IMETHOD ScrollTo(PRInt32 aXScroll, PRInt32 aYScroll) { return _to ScrollTo(aXScroll, aYScroll); } \ NS_IMETHOD ScrollBy(PRInt32 aXScrollDif, PRInt32 aYScrollDif) { return _to ScrollBy(aXScrollDif, aYScrollDif); } \ - NS_IMETHOD ClearTimeout(PRInt32 aTimerID) { return _to ClearTimeout(aTimerID); } \ - NS_IMETHOD ClearInterval(PRInt32 aTimerID) { return _to ClearInterval(aTimerID); } \ - NS_IMETHOD SetTimeout(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn) { return _to SetTimeout(cx, argv, argc, aReturn); } \ - NS_IMETHOD SetInterval(JSContext* cx, jsval* argv, PRUint32 argc, PRInt32* aReturn) { return _to SetInterval(cx, argv, argc, aReturn); } \ - NS_IMETHOD CaptureEvents(PRInt32 aEventFlags) { return _to CaptureEvents(aEventFlags); } \ - NS_IMETHOD ReleaseEvents(PRInt32 aEventFlags) { return _to ReleaseEvents(aEventFlags); } \ - NS_IMETHOD RouteEvent(nsIDOMEvent* aEvt) { return _to RouteEvent(aEvt); } \ - NS_IMETHOD EnableExternalCapture() { return _to EnableExternalCapture(); } \ - NS_IMETHOD DisableExternalCapture() { return _to DisableExternalCapture(); } \ - NS_IMETHOD SetCursor(const nsAReadableString& aCursor) { return _to SetCursor(aCursor); } \ - NS_IMETHOD Open(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to Open(cx, argv, argc, aReturn); } \ - NS_IMETHOD OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, nsIDOMWindow** aReturn) { return _to OpenDialog(cx, argv, argc, aReturn); } \ - NS_IMETHOD Close() { return _to Close(); } \ - NS_IMETHOD Close(JSContext* cx, jsval* argv, PRUint32 argc) { return _to Close(cx, argv, argc); } \ - NS_IMETHOD UpdateCommands(const nsAReadableString& aAction) { return _to UpdateCommands(aAction); } \ - NS_IMETHOD Escape(const nsAReadableString& aStr, nsAWritableString& aReturn) { return _to Escape(aStr, aReturn); } \ - NS_IMETHOD Unescape(const nsAReadableString& aStr, nsAWritableString& aReturn) { return _to Unescape(aStr, aReturn); } \ NS_IMETHOD GetSelection(nsIDOMSelection** aReturn) { return _to GetSelection(aReturn); } \ diff --git a/dom/public/base/nsPIDOMWindow.h b/dom/public/base/nsPIDOMWindow.h index fbc9b2a7d6ed..420f729c4d3d 100644 --- a/dom/public/base/nsPIDOMWindow.h +++ b/dom/public/base/nsPIDOMWindow.h @@ -33,7 +33,7 @@ #include "nsIDocument.h" class nsIDocShell; -class nsIDOMWindow; +class nsIDOMWindowInternal; #define NS_PIDOMWINDOW_IID \ { 0x3aa80781, 0x7e6a, 0x11d3, { 0xbf, 0x87, 0x0, 0x10, 0x5a, 0x1b, 0x6, 0x27 } } @@ -44,7 +44,7 @@ public: static const nsIID& GetIID() { static nsIID iid = NS_PIDOMWINDOW_IID; return iid; } NS_IMETHOD GetPrivateParent(nsPIDOMWindow** aResult)=0; - NS_IMETHOD GetPrivateRoot(nsIDOMWindow** aResult)=0; + NS_IMETHOD GetPrivateRoot(nsIDOMWindowInternal** aResult)=0; NS_IMETHOD GetLocation(nsIDOMLocation** aLocation) = 0; diff --git a/dom/public/domstubs.idl b/dom/public/domstubs.idl index ca68cb4eaa90..34436fe945f6 100644 --- a/dom/public/domstubs.idl +++ b/dom/public/domstubs.idl @@ -66,6 +66,9 @@ interface nsIDOMWindowCollection : nsISupports {}; [scriptable, uuid(a6cf906b-15b3-11d2-932e-00805f8add32)] interface nsIDOMWindow : nsISupports {}; +[scriptable, uuid(9c911860-7dd9-11d4-9a83-000064657374)] +interface nsIDOMWindowInternal : nsIDOMWindow {}; + [scriptable, uuid(a6cf9076-15b3-11d2-932e-00805f8add32)] interface nsIDOMDocumentFragment : nsIDOMNode {}; @@ -97,6 +100,7 @@ interface nsIDOMSelectionListener : nsISupports {}; class nsIDOMBarProp; class nsIDOMWindowCollection; class nsIDOMWindow; + class nsIDOMWindowInternal; class nsIDOMDocumentFragment; class nsIDOMRange; class nsIDOMSelection; diff --git a/dom/public/idl/base/Window.idl b/dom/public/idl/base/Window.idl index c22336b16c8c..ad1bd0eff9d4 100644 --- a/dom/public/idl/base/Window.idl +++ b/dom/public/idl/base/Window.idl @@ -1,16 +1,30 @@ + interface Window { /* IID: { 0xa6cf906b, 0x15b3, 0x11d2, \ { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } } */ + readonly attribute Document document; + readonly attribute Window parent; + readonly replaceable attribute Window top; + readonly attribute BarProp scrollbars; + readonly attribute WindowCollection frames; + attribute wstring name; + readonly attribute long scrollX; + readonly attribute long scrollY; + void scrollTo(in long xScroll, in long yScroll); + void scrollBy(in long xScrollDif, in long yScrollDif); + Selection getSelection(); +}; + +interface WindowInternal : Window { +/* IID: { 0x9c911860, 0x7dd9, 0x11d4, \ + { 0x9a, 0x83, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 } } */ - readonly attribute Window window; - readonly attribute Window self; - readonly attribute Document document; + readonly attribute WindowInternal window; + readonly attribute WindowInternal self; readonly attribute Navigator navigator; readonly attribute Screen screen; readonly attribute History history; - readonly attribute Window parent; - readonly replaceable attribute Window top; - readonly replaceable attribute Window _content; + readonly replaceable attribute WindowInternal _content; readonly replaceable attribute xpidl nsISidebar sidebar; readonly replaceable attribute xpidl nsIPrompt prompter; @@ -19,17 +33,14 @@ interface Window { readonly replaceable attribute BarProp locationbar; readonly replaceable attribute BarProp personalbar; readonly attribute BarProp statusbar; - readonly attribute BarProp scrollbars; readonly attribute BarProp directories; readonly attribute boolean closed; - readonly attribute WindowCollection frames; readonly attribute Crypto crypto; readonly attribute Pkcs11 pkcs11; readonly replaceable attribute xpidl nsIControllers controllers; - attribute Window opener; + attribute WindowInternal opener; attribute wstring status; attribute wstring defaultStatus; - attribute wstring name; attribute jsval location; attribute DOMString title; attribute long innerWidth; @@ -40,8 +51,6 @@ interface Window { attribute long screenY; attribute long pageXOffset; attribute long pageYOffset; - readonly attribute long scrollX; - readonly attribute long scrollY; readonly attribute unsigned long length; void dump(in wstring str); @@ -66,8 +75,6 @@ interface Window { void sizeToContent(); void GetAttention(); void scroll(in long xScroll, in long yScroll); - void scrollTo(in long xScroll, in long yScroll); - void scrollBy(in long xScrollDif, in long yScrollDif); void clearTimeout(in long timerID); void clearInterval(in long timerID); @@ -81,8 +88,8 @@ interface Window { void disableExternalCapture(); void setCursor(in DOMString cursor); - Window open(/* ... */); - Window openDialog(/* ... */); + WindowInternal open(/* ... */); + WindowInternal openDialog(/* ... */); noscript void close(); void close(/* ... */); @@ -90,7 +97,6 @@ interface Window { DOMString escape(in DOMString str); DOMString unescape(in DOMString str); - Selection getSelection(); }; diff --git a/dom/public/nsDOMPropEnums.h b/dom/public/nsDOMPropEnums.h index 358d88d711a7..5d9d4da591b8 100644 --- a/dom/public/nsDOMPropEnums.h +++ b/dom/public/nsDOMPropEnums.h @@ -931,84 +931,18 @@ enum nsDOMProp { NS_DOM_PROP_UIEVENT_INITUIEVENT, NS_DOM_PROP_UIEVENT_VIEW, NS_DOM_PROP_VIEWCSS_GETCOMPUTEDSTYLE, - NS_DOM_PROP_WINDOW__CONTENT, - NS_DOM_PROP_WINDOW_ALERT, - NS_DOM_PROP_WINDOW_BACK, - NS_DOM_PROP_WINDOW_BLUR, - NS_DOM_PROP_WINDOW_CAPTUREEVENTS, - NS_DOM_PROP_WINDOW_CLEARINTERVAL, - NS_DOM_PROP_WINDOW_CLEARTIMEOUT, - NS_DOM_PROP_WINDOW_CLOSE, - NS_DOM_PROP_WINDOW_CLOSED, - NS_DOM_PROP_WINDOW_CONFIRM, - NS_DOM_PROP_WINDOW_CONTROLLERS, - NS_DOM_PROP_WINDOW_CRYPTO, - NS_DOM_PROP_WINDOW_DEFAULTSTATUS, - NS_DOM_PROP_WINDOW_DIRECTORIES, - NS_DOM_PROP_WINDOW_DISABLEEXTERNALCAPTURE, NS_DOM_PROP_WINDOW_DOCUMENT, - NS_DOM_PROP_WINDOW_DUMP, - NS_DOM_PROP_WINDOW_ENABLEEXTERNALCAPTURE, - NS_DOM_PROP_WINDOW_ESCAPE, - NS_DOM_PROP_WINDOW_FOCUS, - NS_DOM_PROP_WINDOW_FORWARD, NS_DOM_PROP_WINDOW_FRAMES, - NS_DOM_PROP_WINDOW_GETATTENTION, NS_DOM_PROP_WINDOW_GETSELECTION, - NS_DOM_PROP_WINDOW_HISTORY, - NS_DOM_PROP_WINDOW_HOME, - NS_DOM_PROP_WINDOW_INNERHEIGHT, - NS_DOM_PROP_WINDOW_INNERWIDTH, - NS_DOM_PROP_WINDOW_LENGTH, - NS_DOM_PROP_WINDOW_LOCATION, - NS_DOM_PROP_WINDOW_LOCATIONBAR, - NS_DOM_PROP_WINDOW_MENUBAR, - NS_DOM_PROP_WINDOW_MOVEBY, - NS_DOM_PROP_WINDOW_MOVETO, NS_DOM_PROP_WINDOW_NAME, - NS_DOM_PROP_WINDOW_NAVIGATOR, - NS_DOM_PROP_WINDOW_OPEN, - NS_DOM_PROP_WINDOW_OPENDIALOG, - NS_DOM_PROP_WINDOW_OPENER, - NS_DOM_PROP_WINDOW_OUTERHEIGHT, - NS_DOM_PROP_WINDOW_OUTERWIDTH, - NS_DOM_PROP_WINDOW_PAGEXOFFSET, - NS_DOM_PROP_WINDOW_PAGEYOFFSET, NS_DOM_PROP_WINDOW_PARENT, - NS_DOM_PROP_WINDOW_PERSONALBAR, - NS_DOM_PROP_WINDOW_PKCS11, - NS_DOM_PROP_WINDOW_PRINT, - NS_DOM_PROP_WINDOW_PROMPT, - NS_DOM_PROP_WINDOW_PROMPTER, - NS_DOM_PROP_WINDOW_RELEASEEVENTS, - NS_DOM_PROP_WINDOW_RESIZEBY, - NS_DOM_PROP_WINDOW_RESIZETO, - NS_DOM_PROP_WINDOW_ROUTEEVENT, - NS_DOM_PROP_WINDOW_SCREEN, - NS_DOM_PROP_WINDOW_SCREENX, - NS_DOM_PROP_WINDOW_SCREENY, NS_DOM_PROP_WINDOW_SCRIPTGLOBALS, - NS_DOM_PROP_WINDOW_SCROLL, NS_DOM_PROP_WINDOW_SCROLLBARS, NS_DOM_PROP_WINDOW_SCROLLBY, NS_DOM_PROP_WINDOW_SCROLLTO, NS_DOM_PROP_WINDOW_SCROLLX, NS_DOM_PROP_WINDOW_SCROLLY, - NS_DOM_PROP_WINDOW_SELF, - NS_DOM_PROP_WINDOW_SETCURSOR, - NS_DOM_PROP_WINDOW_SETINTERVAL, - NS_DOM_PROP_WINDOW_SETTIMEOUT, - NS_DOM_PROP_WINDOW_SIDEBAR, - NS_DOM_PROP_WINDOW_SIZETOCONTENT, - NS_DOM_PROP_WINDOW_STATUS, - NS_DOM_PROP_WINDOW_STATUSBAR, - NS_DOM_PROP_WINDOW_STOP, - NS_DOM_PROP_WINDOW_TITLE, - NS_DOM_PROP_WINDOW_TOOLBAR, NS_DOM_PROP_WINDOW_TOP, - NS_DOM_PROP_WINDOW_UNESCAPE, - NS_DOM_PROP_WINDOW_UPDATECOMMANDS, - NS_DOM_PROP_WINDOW_WINDOW, NS_DOM_PROP_WINDOWCOLLECTION_ITEM, NS_DOM_PROP_WINDOWCOLLECTION_LENGTH, NS_DOM_PROP_WINDOWCOLLECTION_NAMEDITEM, @@ -1036,6 +970,72 @@ enum nsDOMProp { NS_DOM_PROP_WINDOWEVENTOWNER_ONSELECT, NS_DOM_PROP_WINDOWEVENTOWNER_ONSUBMIT, NS_DOM_PROP_WINDOWEVENTOWNER_ONUNLOAD, + NS_DOM_PROP_WINDOWINTERNAL__CONTENT, + NS_DOM_PROP_WINDOWINTERNAL_ALERT, + NS_DOM_PROP_WINDOWINTERNAL_BACK, + NS_DOM_PROP_WINDOWINTERNAL_BLUR, + NS_DOM_PROP_WINDOWINTERNAL_CAPTUREEVENTS, + NS_DOM_PROP_WINDOWINTERNAL_CLEARINTERVAL, + NS_DOM_PROP_WINDOWINTERNAL_CLEARTIMEOUT, + NS_DOM_PROP_WINDOWINTERNAL_CLOSE, + NS_DOM_PROP_WINDOWINTERNAL_CLOSED, + NS_DOM_PROP_WINDOWINTERNAL_CONFIRM, + NS_DOM_PROP_WINDOWINTERNAL_CONTROLLERS, + NS_DOM_PROP_WINDOWINTERNAL_CRYPTO, + NS_DOM_PROP_WINDOWINTERNAL_DEFAULTSTATUS, + NS_DOM_PROP_WINDOWINTERNAL_DIRECTORIES, + NS_DOM_PROP_WINDOWINTERNAL_DISABLEEXTERNALCAPTURE, + NS_DOM_PROP_WINDOWINTERNAL_DUMP, + NS_DOM_PROP_WINDOWINTERNAL_ENABLEEXTERNALCAPTURE, + NS_DOM_PROP_WINDOWINTERNAL_ESCAPE, + NS_DOM_PROP_WINDOWINTERNAL_FOCUS, + NS_DOM_PROP_WINDOWINTERNAL_FORWARD, + NS_DOM_PROP_WINDOWINTERNAL_GETATTENTION, + NS_DOM_PROP_WINDOWINTERNAL_HISTORY, + NS_DOM_PROP_WINDOWINTERNAL_HOME, + NS_DOM_PROP_WINDOWINTERNAL_INNERHEIGHT, + NS_DOM_PROP_WINDOWINTERNAL_INNERWIDTH, + NS_DOM_PROP_WINDOWINTERNAL_LENGTH, + NS_DOM_PROP_WINDOWINTERNAL_LOCATION, + NS_DOM_PROP_WINDOWINTERNAL_LOCATIONBAR, + NS_DOM_PROP_WINDOWINTERNAL_MENUBAR, + NS_DOM_PROP_WINDOWINTERNAL_MOVEBY, + NS_DOM_PROP_WINDOWINTERNAL_MOVETO, + NS_DOM_PROP_WINDOWINTERNAL_NAVIGATOR, + NS_DOM_PROP_WINDOWINTERNAL_OPEN, + NS_DOM_PROP_WINDOWINTERNAL_OPENDIALOG, + NS_DOM_PROP_WINDOWINTERNAL_OPENER, + NS_DOM_PROP_WINDOWINTERNAL_OUTERHEIGHT, + NS_DOM_PROP_WINDOWINTERNAL_OUTERWIDTH, + NS_DOM_PROP_WINDOWINTERNAL_PAGEXOFFSET, + NS_DOM_PROP_WINDOWINTERNAL_PAGEYOFFSET, + NS_DOM_PROP_WINDOWINTERNAL_PERSONALBAR, + NS_DOM_PROP_WINDOWINTERNAL_PKCS11, + NS_DOM_PROP_WINDOWINTERNAL_PRINT, + NS_DOM_PROP_WINDOWINTERNAL_PROMPT, + NS_DOM_PROP_WINDOWINTERNAL_PROMPTER, + NS_DOM_PROP_WINDOWINTERNAL_RELEASEEVENTS, + NS_DOM_PROP_WINDOWINTERNAL_RESIZEBY, + NS_DOM_PROP_WINDOWINTERNAL_RESIZETO, + NS_DOM_PROP_WINDOWINTERNAL_ROUTEEVENT, + NS_DOM_PROP_WINDOWINTERNAL_SCREEN, + NS_DOM_PROP_WINDOWINTERNAL_SCREENX, + NS_DOM_PROP_WINDOWINTERNAL_SCREENY, + NS_DOM_PROP_WINDOWINTERNAL_SCROLL, + NS_DOM_PROP_WINDOWINTERNAL_SELF, + NS_DOM_PROP_WINDOWINTERNAL_SETCURSOR, + NS_DOM_PROP_WINDOWINTERNAL_SETINTERVAL, + NS_DOM_PROP_WINDOWINTERNAL_SETTIMEOUT, + NS_DOM_PROP_WINDOWINTERNAL_SIDEBAR, + NS_DOM_PROP_WINDOWINTERNAL_SIZETOCONTENT, + NS_DOM_PROP_WINDOWINTERNAL_STATUS, + NS_DOM_PROP_WINDOWINTERNAL_STATUSBAR, + NS_DOM_PROP_WINDOWINTERNAL_STOP, + NS_DOM_PROP_WINDOWINTERNAL_TITLE, + NS_DOM_PROP_WINDOWINTERNAL_TOOLBAR, + NS_DOM_PROP_WINDOWINTERNAL_UNESCAPE, + NS_DOM_PROP_WINDOWINTERNAL_UPDATECOMMANDS, + NS_DOM_PROP_WINDOWINTERNAL_WINDOW, NS_DOM_PROP_XULBROWSERELEMENT_WEBBROWSER, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, NS_DOM_PROP_XULCOMMANDDISPATCHER_ADDCOMMANDUPDATER, diff --git a/dom/public/nsDOMPropNames.h b/dom/public/nsDOMPropNames.h index 1e2783176ee0..0ca338282e47 100644 --- a/dom/public/nsDOMPropNames.h +++ b/dom/public/nsDOMPropNames.h @@ -929,84 +929,18 @@ "uievent.inituievent", \ "uievent.view", \ "viewcss.getcomputedstyle", \ - "window._content", \ - "window.alert", \ - "window.back", \ - "window.blur", \ - "window.captureevents", \ - "window.clearinterval", \ - "window.cleartimeout", \ - "window.close", \ - "window.closed", \ - "window.confirm", \ - "window.controllers", \ - "window.crypto", \ - "window.defaultstatus", \ - "window.directories", \ - "window.disableexternalcapture", \ "window.document", \ - "window.dump", \ - "window.enableexternalcapture", \ - "window.escape", \ - "window.focus", \ - "window.forward", \ "window.frames", \ - "window.getattention", \ "window.getselection", \ - "window.history", \ - "window.home", \ - "window.innerheight", \ - "window.innerwidth", \ - "window.length", \ - "window.location", \ - "window.locationbar", \ - "window.menubar", \ - "window.moveby", \ - "window.moveto", \ "window.name", \ - "window.navigator", \ - "window.open", \ - "window.opendialog", \ - "window.opener", \ - "window.outerheight", \ - "window.outerwidth", \ - "window.pagexoffset", \ - "window.pageyoffset", \ "window.parent", \ - "window.personalbar", \ - "window.pkcs11", \ - "window.print", \ - "window.prompt", \ - "window.prompter", \ - "window.releaseevents", \ - "window.resizeby", \ - "window.resizeto", \ - "window.routeevent", \ - "window.screen", \ - "window.screenx", \ - "window.screeny", \ "window.scriptglobals", \ - "window.scroll", \ "window.scrollbars", \ "window.scrollby", \ "window.scrollto", \ "window.scrollx", \ "window.scrolly", \ - "window.self", \ - "window.setcursor", \ - "window.setinterval", \ - "window.settimeout", \ - "window.sidebar", \ - "window.sizetocontent", \ - "window.status", \ - "window.statusbar", \ - "window.stop", \ - "window.title", \ - "window.toolbar", \ "window.top", \ - "window.unescape", \ - "window.updatecommands", \ - "window.window", \ "windowcollection.item", \ "windowcollection.length", \ "windowcollection.nameditem", \ @@ -1034,6 +968,72 @@ "windoweventowner.onselect", \ "windoweventowner.onsubmit", \ "windoweventowner.onunload", \ + "windowinternal._content", \ + "windowinternal.alert", \ + "windowinternal.back", \ + "windowinternal.blur", \ + "windowinternal.captureevents", \ + "windowinternal.clearinterval", \ + "windowinternal.cleartimeout", \ + "windowinternal.close", \ + "windowinternal.closed", \ + "windowinternal.confirm", \ + "windowinternal.controllers", \ + "windowinternal.crypto", \ + "windowinternal.defaultstatus", \ + "windowinternal.directories", \ + "windowinternal.disableexternalcapture", \ + "windowinternal.dump", \ + "windowinternal.enableexternalcapture", \ + "windowinternal.escape", \ + "windowinternal.focus", \ + "windowinternal.forward", \ + "windowinternal.getattention", \ + "windowinternal.history", \ + "windowinternal.home", \ + "windowinternal.innerheight", \ + "windowinternal.innerwidth", \ + "windowinternal.length", \ + "windowinternal.location", \ + "windowinternal.locationbar", \ + "windowinternal.menubar", \ + "windowinternal.moveby", \ + "windowinternal.moveto", \ + "windowinternal.navigator", \ + "windowinternal.open", \ + "windowinternal.opendialog", \ + "windowinternal.opener", \ + "windowinternal.outerheight", \ + "windowinternal.outerwidth", \ + "windowinternal.pagexoffset", \ + "windowinternal.pageyoffset", \ + "windowinternal.personalbar", \ + "windowinternal.pkcs11", \ + "windowinternal.print", \ + "windowinternal.prompt", \ + "windowinternal.prompter", \ + "windowinternal.releaseevents", \ + "windowinternal.resizeby", \ + "windowinternal.resizeto", \ + "windowinternal.routeevent", \ + "windowinternal.screen", \ + "windowinternal.screenx", \ + "windowinternal.screeny", \ + "windowinternal.scroll", \ + "windowinternal.self", \ + "windowinternal.setcursor", \ + "windowinternal.setinterval", \ + "windowinternal.settimeout", \ + "windowinternal.sidebar", \ + "windowinternal.sizetocontent", \ + "windowinternal.status", \ + "windowinternal.statusbar", \ + "windowinternal.stop", \ + "windowinternal.title", \ + "windowinternal.toolbar", \ + "windowinternal.unescape", \ + "windowinternal.updatecommands", \ + "windowinternal.window", \ "xulbrowserelement.webbrowser", \ "xulcommanddispatcher.active", \ "xulcommanddispatcher.addcommandupdater", \ diff --git a/dom/public/nsIScriptGlobalObject.h b/dom/public/nsIScriptGlobalObject.h index aedab8a74b4d..16487e42afb1 100644 --- a/dom/public/nsIScriptGlobalObject.h +++ b/dom/public/nsIScriptGlobalObject.h @@ -32,7 +32,7 @@ class nsIDOMDocument; class nsIDOMEvent; class nsIPresContext; class nsIDocShell; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIScriptGlobalObjectOwner; #define NS_ISCRIPTGLOBALOBJECT_IID \ @@ -53,7 +53,7 @@ public: NS_IMETHOD SetNewDocument(nsIDOMDocument *aDocument)=0; NS_IMETHOD SetDocShell(nsIDocShell *aDocShell)=0; NS_IMETHOD GetDocShell(nsIDocShell **aDocShell)=0; - NS_IMETHOD SetOpenerWindow(nsIDOMWindow *aOpener)=0; + NS_IMETHOD SetOpenerWindow(nsIDOMWindowInternal *aOpener)=0; /** * Let the script global object know who its owner is. diff --git a/dom/public/xul/nsIDOMXULCommandDispatcher.h b/dom/public/xul/nsIDOMXULCommandDispatcher.h index b5bc0a7a1d54..3153278e4a23 100644 --- a/dom/public/xul/nsIDOMXULCommandDispatcher.h +++ b/dom/public/xul/nsIDOMXULCommandDispatcher.h @@ -30,7 +30,7 @@ class nsIController; class nsIDOMElement; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIControllers; #define NS_IDOMXULCOMMANDDISPATCHER_IID \ @@ -44,8 +44,8 @@ public: NS_IMETHOD GetFocusedElement(nsIDOMElement** aFocusedElement)=0; NS_IMETHOD SetFocusedElement(nsIDOMElement* aFocusedElement)=0; - NS_IMETHOD GetFocusedWindow(nsIDOMWindow** aFocusedWindow)=0; - NS_IMETHOD SetFocusedWindow(nsIDOMWindow* aFocusedWindow)=0; + NS_IMETHOD GetFocusedWindow(nsIDOMWindowInternal** aFocusedWindow)=0; + NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aFocusedWindow)=0; NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFocus)=0; NS_IMETHOD SetSuppressFocus(PRBool aSuppressFocus)=0; @@ -71,8 +71,8 @@ public: #define NS_DECL_IDOMXULCOMMANDDISPATCHER \ NS_IMETHOD GetFocusedElement(nsIDOMElement** aFocusedElement); \ NS_IMETHOD SetFocusedElement(nsIDOMElement* aFocusedElement); \ - NS_IMETHOD GetFocusedWindow(nsIDOMWindow** aFocusedWindow); \ - NS_IMETHOD SetFocusedWindow(nsIDOMWindow* aFocusedWindow); \ + NS_IMETHOD GetFocusedWindow(nsIDOMWindowInternal** aFocusedWindow); \ + NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aFocusedWindow); \ NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFocus); \ NS_IMETHOD SetSuppressFocus(PRBool aSuppressFocus); \ NS_IMETHOD GetSuppressFocusScroll(PRBool* aSuppressFocusScroll); \ @@ -90,8 +90,8 @@ public: #define NS_FORWARD_IDOMXULCOMMANDDISPATCHER(_to) \ NS_IMETHOD GetFocusedElement(nsIDOMElement** aFocusedElement) { return _to GetFocusedElement(aFocusedElement); } \ NS_IMETHOD SetFocusedElement(nsIDOMElement* aFocusedElement) { return _to SetFocusedElement(aFocusedElement); } \ - NS_IMETHOD GetFocusedWindow(nsIDOMWindow** aFocusedWindow) { return _to GetFocusedWindow(aFocusedWindow); } \ - NS_IMETHOD SetFocusedWindow(nsIDOMWindow* aFocusedWindow) { return _to SetFocusedWindow(aFocusedWindow); } \ + NS_IMETHOD GetFocusedWindow(nsIDOMWindowInternal** aFocusedWindow) { return _to GetFocusedWindow(aFocusedWindow); } \ + NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aFocusedWindow) { return _to SetFocusedWindow(aFocusedWindow); } \ NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFocus) { return _to GetSuppressFocus(aSuppressFocus); } \ NS_IMETHOD SetSuppressFocus(PRBool aSuppressFocus) { return _to SetSuppressFocus(aSuppressFocus); } \ NS_IMETHOD GetSuppressFocusScroll(PRBool* aSuppressFocusScroll) { return _to GetSuppressFocusScroll(aSuppressFocusScroll); } \ diff --git a/dom/src/base/nsBarProps.cpp b/dom/src/base/nsBarProps.cpp index 362f598ca203..b775f7f71662 100644 --- a/dom/src/base/nsBarProps.cpp +++ b/dom/src/base/nsBarProps.cpp @@ -25,7 +25,7 @@ #include "nscore.h" #include "nsBarProps.h" #include "nsIWebBrowserChrome.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" // @@ -57,7 +57,7 @@ NS_IMETHODIMP BarPropImpl::GetScriptObject(nsIScriptContext *aContext, { nsCOMPtr global; global = aContext->GetGlobalObject(); - nsCOMPtr domWindow(do_QueryInterface(global)); + nsCOMPtr domWindow(do_QueryInterface(global)); NS_ENSURE_SUCCESS(NS_NewScriptBarProp(aContext, NS_STATIC_CAST(nsIDOMBarProp*, this), domWindow, &mScriptObject), NS_ERROR_FAILURE); diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index 68956e9864a0..45ca8e37b040 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -169,10 +169,11 @@ NS_IMPL_RELEASE(GlobalWindowImpl) NS_INTERFACE_MAP_BEGIN(GlobalWindowImpl) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject) + NS_INTERFACE_MAP_ENTRY(nsIDOMWindowInternal) + NS_INTERFACE_MAP_ENTRY(nsIDOMWindow) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectOwner) NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject) NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal) - NS_INTERFACE_MAP_ENTRY(nsIDOMWindow) NS_INTERFACE_MAP_ENTRY(nsIJSScriptObject) NS_INTERFACE_MAP_ENTRY(nsIDOMEventReceiver) NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget) @@ -391,7 +392,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetDocShell(nsIDocShell ** aDocShell) return NS_OK; } -NS_IMETHODIMP GlobalWindowImpl::SetOpenerWindow(nsIDOMWindow* aOpener) +NS_IMETHODIMP GlobalWindowImpl::SetOpenerWindow(nsIDOMWindowInternal* aOpener) { mOpener = aOpener; return NS_OK; @@ -512,20 +513,6 @@ NS_IMETHODIMP GlobalWindowImpl::GetPrincipal(nsIPrincipal** result) // GlobalWindowImpl::nsIDOMWindow //***************************************************************************** -NS_IMETHODIMP GlobalWindowImpl::GetWindow(nsIDOMWindow** aWindow) -{ - *aWindow = NS_STATIC_CAST(nsIDOMWindow *, this); - NS_ADDREF(*aWindow); - return NS_OK; -} - -NS_IMETHODIMP GlobalWindowImpl::GetSelf(nsIDOMWindow** aWindow) -{ - *aWindow = NS_STATIC_CAST(nsIDOMWindow *, this); - NS_ADDREF(*aWindow); - return NS_OK; -} - NS_IMETHODIMP GlobalWindowImpl::GetDocument(nsIDOMDocument** aDocument) { *aDocument = mDocument; @@ -533,6 +520,24 @@ NS_IMETHODIMP GlobalWindowImpl::GetDocument(nsIDOMDocument** aDocument) return NS_OK; } +//***************************************************************************** +// GlobalWindowImpl::nsIDOMWindowInternal +//***************************************************************************** + +NS_IMETHODIMP GlobalWindowImpl::GetWindow(nsIDOMWindowInternal** aWindow) +{ + *aWindow = NS_STATIC_CAST(nsIDOMWindowInternal *, this); + NS_ADDREF(*aWindow); + return NS_OK; +} + +NS_IMETHODIMP GlobalWindowImpl::GetSelf(nsIDOMWindowInternal** aWindow) +{ + *aWindow = NS_STATIC_CAST(nsIDOMWindowInternal *, this); + NS_ADDREF(*aWindow); + return NS_OK; +} + NS_IMETHODIMP GlobalWindowImpl::GetNavigator(nsIDOMNavigator** aNavigator) { if (!mNavigator) { @@ -591,7 +596,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetParent(nsIDOMWindow** aParent) NS_ERROR_FAILURE); } else { - *aParent = NS_STATIC_CAST(nsIDOMWindow *, this); + *aParent = NS_STATIC_CAST(nsIDOMWindowInternal *, this); NS_ADDREF(*aParent); } return NS_OK; @@ -616,7 +621,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetTop(nsIDOMWindow** aTop) return ret; } -NS_IMETHODIMP GlobalWindowImpl::Get_content(nsIDOMWindow** aContent) +NS_IMETHODIMP GlobalWindowImpl::Get_content(nsIDOMWindowInternal** aContent) { *aContent = nsnull; @@ -627,7 +632,7 @@ NS_IMETHODIMP GlobalWindowImpl::Get_content(nsIDOMWindow** aContent) nsCOMPtr primaryContent; treeOwner->GetPrimaryContentShell(getter_AddRefs(primaryContent)); - nsCOMPtr domWindow(do_GetInterface(primaryContent)); + nsCOMPtr domWindow(do_GetInterface(primaryContent)); *aContent = domWindow; NS_IF_ADDREF(*aContent); @@ -643,7 +648,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetSidebar(nsISidebar** aSidebar) mSidebar = do_CreateInstance(NS_SIDEBAR_PROGID, &rv); if (mSidebar) { - nsIDOMWindow *win = NS_STATIC_CAST(nsIDOMWindow *, this); + nsIDOMWindowInternal *win = NS_STATIC_CAST(nsIDOMWindowInternal *, this); /* no addref */ mSidebar->SetWindow(win); } @@ -850,14 +855,14 @@ NS_IMETHODIMP GlobalWindowImpl::GetControllers(nsIControllers** aResult) return NS_OK; } -NS_IMETHODIMP GlobalWindowImpl::GetOpener(nsIDOMWindow** aOpener) +NS_IMETHODIMP GlobalWindowImpl::GetOpener(nsIDOMWindowInternal** aOpener) { *aOpener = mOpener; NS_IF_ADDREF(*aOpener); return NS_OK; } -NS_IMETHODIMP GlobalWindowImpl::SetOpener(nsIDOMWindow* aOpener) +NS_IMETHODIMP GlobalWindowImpl::SetOpener(nsIDOMWindowInternal* aOpener) { mOpener = aOpener; return NS_OK; @@ -1013,7 +1018,7 @@ GlobalWindowImpl::SetTitle(const nsAReadableString& aTitle) NS_IMETHODIMP GlobalWindowImpl::GetInnerWidth(PRInt32* aInnerWidth) { - nsCOMPtr parent; + nsCOMPtr parent; nsCOMPtr docShellWin(do_QueryInterface(mDocShell)); *aInnerWidth = 0; @@ -1053,7 +1058,7 @@ NS_IMETHODIMP GlobalWindowImpl::SetInnerWidth(PRInt32 aInnerWidth) NS_IMETHODIMP GlobalWindowImpl::GetInnerHeight(PRInt32* aInnerHeight) { - nsCOMPtr parent; + nsCOMPtr parent; FlushPendingNotifications(); @@ -1899,7 +1904,7 @@ NS_IMETHODIMP GlobalWindowImpl::SetCursor(const nsAReadableString& aCursor) } NS_IMETHODIMP GlobalWindowImpl::Open(JSContext* cx, jsval* argv, PRUint32 argc, - nsIDOMWindow** aReturn) + nsIDOMWindowInternal** aReturn) { return OpenInternal(cx, argv, argc, PR_FALSE, aReturn); } @@ -1908,7 +1913,7 @@ NS_IMETHODIMP GlobalWindowImpl::Open(JSContext* cx, jsval* argv, PRUint32 argc, // [features] as a JS property named "arguments" NS_IMETHODIMP GlobalWindowImpl::OpenDialog(JSContext* cx, jsval* argv, PRUint32 argc, - nsIDOMWindow** aReturn) + nsIDOMWindowInternal** aReturn) { return OpenInternal(cx, argv, argc, PR_TRUE, aReturn); } @@ -1969,7 +1974,7 @@ NS_IMETHODIMP GlobalWindowImpl::UpdateCommands(const nsAReadableString& anAction if (!doc) return NS_ERROR_NULL_POINTER; doc->GetScriptGlobalObject(getter_AddRefs(global)); - nsCOMPtr domWindow = do_QueryInterface(global); + nsCOMPtr domWindow = do_QueryInterface(global); return domWindow->UpdateCommands(anAction); } else { @@ -1997,7 +2002,8 @@ NS_IMETHODIMP GlobalWindowImpl::UpdateCommands(const nsAReadableString& anAction if (NS_STATIC_CAST(nsIDOMWindow *, this) == parent.get()) return NS_OK; - return parent->UpdateCommands(anAction); + nsCOMPtr parentInternal = do_QueryInterface(parent); + return parentInternal->UpdateCommands(anAction); } return NS_OK; @@ -2429,7 +2435,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetPrivateParent(nsPIDOMWindow ** aParent) return NS_OK; } -NS_IMETHODIMP GlobalWindowImpl::GetPrivateRoot(nsIDOMWindow ** aParent) +NS_IMETHODIMP GlobalWindowImpl::GetPrivateRoot(nsIDOMWindowInternal ** aParent) { *aParent = nsnull; // Set to null so we can bail out later @@ -2451,14 +2457,15 @@ NS_IMETHODIMP GlobalWindowImpl::GetPrivateRoot(nsIDOMWindow ** aParent) doc->GetScriptGlobalObject(getter_AddRefs(globalObject)); parent = do_QueryInterface(globalObject); - parent->GetTop(aParent); // Addref done here. + nsCOMPtr tempParent; + parent->GetTop(getter_AddRefs(tempParent)); + CallQueryInterface(tempParent, aParent); return NS_OK; } } if (parent) { - *aParent = parent.get(); - NS_ADDREF(*aParent); + CallQueryInterface(parent, aParent); } return NS_OK; @@ -2662,7 +2669,7 @@ GlobalWindowImpl::GetRootCommandDispatcher(nsIDocument *aDoc, nsCOMPtr commandDispatcher; nsCOMPtr ourGlobal; aDoc->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if (ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -2764,7 +2771,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetDocument(nsIDOMDocumentView ** aDocumentView) NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext *cx, jsval *argv, PRUint32 argc, PRBool aDialog, - nsIDOMWindow ** aReturn) + nsIDOMWindowInternal ** aReturn) { PRUint32 chromeFlags; nsAutoString name; @@ -2973,7 +2980,7 @@ NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext *cx, // attach the given array of JS values to the given window, as a property array // named "arguments" -NS_IMETHODIMP GlobalWindowImpl::AttachArguments(nsIDOMWindow *aWindow, +NS_IMETHODIMP GlobalWindowImpl::AttachArguments(nsIDOMWindowInternal *aWindow, jsval *argv, PRUint32 argc) { if (argc == 0) @@ -3315,13 +3322,13 @@ GlobalWindowImpl::SizeOpenedDocShellItem(nsIDocShellTreeItem *aDocShellItem, return NS_OK; } -// Return the nsIDOMWindow corresponding to the given nsIWebShell. +// Return the nsIDOMWindowInternal corresponding to the given nsIWebShell. // Note this forces the creation of a script context, if one has not already // been created. Note it also sets the window's opener to this -- because // it's just convenient, that's all. NS_IMETHODIMP GlobalWindowImpl::ReadyOpenedDocShellItem(nsIDocShellTreeItem *aDocShellItem, - nsIDOMWindow **aDOMWindow) + nsIDOMWindowInternal **aDOMWindow) { nsresult res; @@ -3401,7 +3408,7 @@ PRInt32 GlobalWindowImpl::WinHasOption(char *aOptions, const char *aName, void GlobalWindowImpl::CloseWindow(nsISupports *aWindow) { - nsCOMPtr win(do_QueryInterface(aWindow)); + nsCOMPtr win(do_QueryInterface(aWindow)); win->Close(); } @@ -4756,7 +4763,7 @@ NS_INTERFACE_MAP_BEGIN(nsDOMWindowController) NS_INTERFACE_MAP_END //NS_IMPL_QUERY_INTERFACE1(nsDOMWindowController, nsIController) -nsDOMWindowController::nsDOMWindowController(nsIDOMWindow *aWindow) +nsDOMWindowController::nsDOMWindowController(nsIDOMWindowInternal *aWindow) { NS_INIT_REFCNT(); mWindow = aWindow; diff --git a/dom/src/base/nsGlobalWindow.h b/dom/src/base/nsGlobalWindow.h index 8d67d995fe3e..52d44e491ceb 100644 --- a/dom/src/base/nsGlobalWindow.h +++ b/dom/src/base/nsGlobalWindow.h @@ -40,7 +40,7 @@ #include "nsIDOMEventReceiver.h" #include "nsIDOMNavigator.h" #include "nsIDOMNSLocation.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowEventOwner.h" #include "nsIJSScriptObject.h" #include "nsIScriptGlobalObject.h" @@ -77,7 +77,7 @@ class nsIDocShellLoadInfo; // GlobalWindowImpl: Global Object for Scripting //***************************************************************************** class GlobalWindowImpl : public nsIScriptGlobalObject, - public nsIDOMWindow, + public nsIDOMWindowInternal, public nsIJSScriptObject, public nsIScriptObjectPrincipal, public nsIDOMEventReceiver, @@ -100,7 +100,7 @@ public: NS_IMETHOD SetNewDocument(nsIDOMDocument *aDocument); NS_IMETHOD SetDocShell(nsIDocShell* aDocShell); NS_IMETHOD GetDocShell(nsIDocShell** aDocShell); - NS_IMETHOD SetOpenerWindow(nsIDOMWindow *aOpener); + NS_IMETHOD SetOpenerWindow(nsIDOMWindowInternal *aOpener); NS_IMETHOD SetGlobalObjectOwner(nsIScriptGlobalObjectOwner* aOwner); NS_IMETHOD GetGlobalObjectOwner(nsIScriptGlobalObjectOwner** aOwner); NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, @@ -113,6 +113,9 @@ public: // nsIDOMWindow NS_DECL_IDOMWINDOW + // nsIDOMWindowInternal + NS_DECL_IDOMWINDOWINTERNAL + // nsIJSScriptObject virtual PRBool AddProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval *aVp); @@ -145,7 +148,7 @@ public: // nsPIDOMWindow NS_IMETHOD GetPrivateParent(nsPIDOMWindow** aResult); - NS_IMETHOD GetPrivateRoot(nsIDOMWindow** aResult); + NS_IMETHOD GetPrivateRoot(nsIDOMWindowInternal** aResult); NS_IMETHOD GetLocation(nsIDOMLocation** aLocation); @@ -184,13 +187,13 @@ protected: // Window Control Functions NS_IMETHOD OpenInternal(JSContext* cx, jsval* argv, PRUint32 argc, - PRBool aDialog, nsIDOMWindow** aReturn); - NS_IMETHOD AttachArguments(nsIDOMWindow* aWindow, jsval* argv, PRUint32 argc); + PRBool aDialog, nsIDOMWindowInternal** aReturn); + NS_IMETHOD AttachArguments(nsIDOMWindowInternal* aWindow, jsval* argv, PRUint32 argc); PRUint32 CalculateChromeFlags(char* aFeatures, PRBool aDialog); NS_IMETHOD SizeOpenedDocShellItem(nsIDocShellTreeItem* aDocShellItem, char* aFeatures, PRUint32 aChromeFlags); NS_IMETHOD ReadyOpenedDocShellItem(nsIDocShellTreeItem* aDocShellItem, - nsIDOMWindow** aDOMWindow); + nsIDOMWindowInternal** aDOMWindow); NS_IMETHOD CheckWindowName(JSContext* cx, nsString& aName); PRInt32 WinHasOption(char* aOptions, const char* aName, PRInt32 aDefault, PRBool* aPresenceFlag); static void CloseWindow(nsISupports* aWindow); @@ -222,7 +225,7 @@ protected: protected: nsCOMPtr mContext; nsCOMPtr mDocument; - nsCOMPtr mOpener; + nsCOMPtr mOpener; nsCOMPtr mControllers; nsCOMPtr mListenerManager; nsCOMPtr mSidebar; @@ -385,7 +388,7 @@ class nsISelectionController; class nsDOMWindowController : public nsIController { public: - nsDOMWindowController( nsIDOMWindow* aWindow ); + nsDOMWindowController( nsIDOMWindowInternal* aWindow ); NS_DECL_ISUPPORTS NS_DECL_NSICONTROLLER @@ -394,7 +397,7 @@ private: nsresult GetEditInterface( nsIContentViewerEdit** aEditInterface); nsresult GetSelectionController(nsISelectionController ** aSelCon); - nsIDOMWindow *mWindow; + nsIDOMWindowInternal *mWindow; }; #endif // DOM_CONTROLLER diff --git a/dom/src/base/nsHistory.cpp b/dom/src/base/nsHistory.cpp index 42fe96382595..a2633aa63b36 100644 --- a/dom/src/base/nsHistory.cpp +++ b/dom/src/base/nsHistory.cpp @@ -24,7 +24,7 @@ #include "nsCOMPtr.h" #include "nscore.h" #include "nsHistory.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIWebShell.h" #include "nsIDocShell.h" diff --git a/dom/src/base/nsJSEnvironment.cpp b/dom/src/base/nsJSEnvironment.cpp index f23ee6bc9dcc..e9d2ca1d55fa 100644 --- a/dom/src/base/nsJSEnvironment.cpp +++ b/dom/src/base/nsJSEnvironment.cpp @@ -25,7 +25,7 @@ #include "nsIScriptContextOwner.h" #include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObjectOwner.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMNode.h" #include "nsIDOMElement.h" #include "nsIDOMDocument.h" diff --git a/dom/src/base/nsJSWindow.cpp b/dom/src/base/nsJSWindow.cpp index ec850d193714..bb8299b9059f 100644 --- a/dom/src/base/nsJSWindow.cpp +++ b/dom/src/base/nsJSWindow.cpp @@ -45,6 +45,7 @@ #include "nsIDOMAbstractView.h" #include "nsIDOMScreen.h" #include "nsIDOMHistory.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMEvent.h" #include "nsIDOMWindowCollection.h" #include "nsIDOMEventListener.h" @@ -72,6 +73,7 @@ static NS_DEFINE_IID(kIBarPropIID, NS_IDOMBARPROP_IID); static NS_DEFINE_IID(kIAbstractViewIID, NS_IDOMABSTRACTVIEW_IID); static NS_DEFINE_IID(kIScreenIID, NS_IDOMSCREEN_IID); static NS_DEFINE_IID(kIHistoryIID, NS_IDOMHISTORY_IID); +static NS_DEFINE_IID(kIWindowInternalIID, NS_IDOMWINDOWINTERNAL_IID); static NS_DEFINE_IID(kIEventIID, NS_IDOMEVENT_IID); static NS_DEFINE_IID(kIWindowCollectionIID, NS_IDOMWINDOWCOLLECTION_IID); static NS_DEFINE_IID(kIEventListenerIID, NS_IDOMEVENTLISTENER_IID); @@ -88,46 +90,46 @@ static NS_DEFINE_IID(kIWindowEventOwnerIID, NS_IDOMWINDOWEVENTOWNER_IID); // Window property ids // enum Window_slots { - WINDOW_WINDOW = -1, - WINDOW_SELF = -2, - WINDOW_DOCUMENT = -3, - WINDOW_NAVIGATOR = -4, - WINDOW_SCREEN = -5, - WINDOW_HISTORY = -6, - WINDOW_PARENT = -7, - WINDOW_TOP = -8, - WINDOW__CONTENT = -9, - WINDOW_SIDEBAR = -10, - WINDOW_PROMPTER = -11, - WINDOW_MENUBAR = -12, - WINDOW_TOOLBAR = -13, - WINDOW_LOCATIONBAR = -14, - WINDOW_PERSONALBAR = -15, - WINDOW_STATUSBAR = -16, - WINDOW_SCROLLBARS = -17, - WINDOW_DIRECTORIES = -18, - WINDOW_CLOSED = -19, - WINDOW_FRAMES = -20, - WINDOW_CRYPTO = -21, - WINDOW_PKCS11 = -22, - WINDOW_CONTROLLERS = -23, - WINDOW_OPENER = -24, - WINDOW_STATUS = -25, - WINDOW_DEFAULTSTATUS = -26, - WINDOW_NAME = -27, - WINDOW_LOCATION = -28, - WINDOW_TITLE = -29, - WINDOW_INNERWIDTH = -30, - WINDOW_INNERHEIGHT = -31, - WINDOW_OUTERWIDTH = -32, - WINDOW_OUTERHEIGHT = -33, - WINDOW_SCREENX = -34, - WINDOW_SCREENY = -35, - WINDOW_PAGEXOFFSET = -36, - WINDOW_PAGEYOFFSET = -37, - WINDOW_SCROLLX = -38, - WINDOW_SCROLLY = -39, - WINDOW_LENGTH = -40, + WINDOW_DOCUMENT = -1, + WINDOW_PARENT = -2, + WINDOW_TOP = -3, + WINDOW_SCROLLBARS = -4, + WINDOW_FRAMES = -5, + WINDOW_NAME = -6, + WINDOW_SCROLLX = -7, + WINDOW_SCROLLY = -8, + WINDOWINTERNAL_WINDOW = -9, + WINDOWINTERNAL_SELF = -10, + WINDOWINTERNAL_NAVIGATOR = -11, + WINDOWINTERNAL_SCREEN = -12, + WINDOWINTERNAL_HISTORY = -13, + WINDOWINTERNAL__CONTENT = -14, + WINDOWINTERNAL_SIDEBAR = -15, + WINDOWINTERNAL_PROMPTER = -16, + WINDOWINTERNAL_MENUBAR = -17, + WINDOWINTERNAL_TOOLBAR = -18, + WINDOWINTERNAL_LOCATIONBAR = -19, + WINDOWINTERNAL_PERSONALBAR = -20, + WINDOWINTERNAL_STATUSBAR = -21, + WINDOWINTERNAL_DIRECTORIES = -22, + WINDOWINTERNAL_CLOSED = -23, + WINDOWINTERNAL_CRYPTO = -24, + WINDOWINTERNAL_PKCS11 = -25, + WINDOWINTERNAL_CONTROLLERS = -26, + WINDOWINTERNAL_OPENER = -27, + WINDOWINTERNAL_STATUS = -28, + WINDOWINTERNAL_DEFAULTSTATUS = -29, + WINDOWINTERNAL_LOCATION = -30, + WINDOWINTERNAL_TITLE = -31, + WINDOWINTERNAL_INNERWIDTH = -32, + WINDOWINTERNAL_INNERHEIGHT = -33, + WINDOWINTERNAL_OUTERWIDTH = -34, + WINDOWINTERNAL_OUTERHEIGHT = -35, + WINDOWINTERNAL_SCREENX = -36, + WINDOWINTERNAL_SCREENY = -37, + WINDOWINTERNAL_PAGEXOFFSET = -38, + WINDOWINTERNAL_PAGEYOFFSET = -39, + WINDOWINTERNAL_LENGTH = -40, WINDOWEVENTOWNER_ONMOUSEDOWN = -41, WINDOWEVENTOWNER_ONMOUSEUP = -42, WINDOWEVENTOWNER_ONCLICK = -43, @@ -176,32 +178,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) if (!secMan) return PR_FALSE; switch(JSVAL_TO_INT(id)) { - case WINDOW_WINDOW: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_WINDOW, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; - rv = a->GetWindow(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_SELF: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SELF, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; - rv = a->GetSelf(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } case WINDOW_DOCUMENT: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_DOCUMENT, PR_FALSE); @@ -215,45 +191,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_NAVIGATOR: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_NAVIGATOR, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMNavigator* prop; - rv = a->GetNavigator(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_SCREEN: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCREEN, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMScreen* prop; - rv = a->GetScreen(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_HISTORY: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_HISTORY, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMHistory* prop; - rv = a->GetHistory(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } case WINDOW_PARENT: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PARENT, PR_FALSE); @@ -267,19 +204,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_STATUSBAR: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_STATUSBAR, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMBarProp* prop; - rv = a->GetStatusbar(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } case WINDOW_SCROLLBARS: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCROLLBARS, PR_FALSE); @@ -293,31 +217,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_DIRECTORIES: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_DIRECTORIES, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMBarProp* prop; - rv = a->GetDirectories(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_CLOSED: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CLOSED, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRBool prop; - rv = a->GetClosed(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = BOOLEAN_TO_JSVAL(prop); - } - } - break; - } case WINDOW_FRAMES: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_FRAMES, PR_FALSE); @@ -331,69 +230,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_CRYPTO: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CRYPTO, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMCrypto* prop; - rv = a->GetCrypto(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_PKCS11: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PKCS11, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMPkcs11* prop; - rv = a->GetPkcs11(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_OPENER: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OPENER, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; - rv = a->GetOpener(&prop); - if (NS_SUCCEEDED(rv)) { - // get the js object - nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); - } - } - break; - } - case WINDOW_STATUS: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_STATUS, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsAutoString prop; - rv = a->GetStatus(prop); - if (NS_SUCCEEDED(rv)) { - nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); - } - } - break; - } - case WINDOW_DEFAULTSTATUS: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_DEFAULTSTATUS, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsAutoString prop; - rv = a->GetDefaultStatus(prop); - if (NS_SUCCEEDED(rv)) { - nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); - } - } - break; - } case WINDOW_NAME: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_NAME, PR_FALSE); @@ -406,122 +242,6 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_LOCATION: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_LOCATION, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - rv = a->GetLocation(vp); - } - break; - } - case WINDOW_TITLE: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_TITLE, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - nsAutoString prop; - rv = a->GetTitle(prop); - if (NS_SUCCEEDED(rv)) { - nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); - } - } - break; - } - case WINDOW_INNERWIDTH: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_INNERWIDTH, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetInnerWidth(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_INNERHEIGHT: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_INNERHEIGHT, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetInnerHeight(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_OUTERWIDTH: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OUTERWIDTH, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetOuterWidth(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_OUTERHEIGHT: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OUTERHEIGHT, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetOuterHeight(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_SCREENX: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCREENX, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetScreenX(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_SCREENY: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCREENY, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetScreenY(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_PAGEXOFFSET: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PAGEXOFFSET, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetPageXOffset(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } - case WINDOW_PAGEYOFFSET: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PAGEYOFFSET, PR_FALSE); - if (NS_SUCCEEDED(rv)) { - PRInt32 prop; - rv = a->GetPageYOffset(&prop); - if (NS_SUCCEEDED(rv)) { - *vp = INT_TO_JSVAL(prop); - } - } - break; - } case WINDOW_SCROLLX: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCROLLX, PR_FALSE); @@ -546,14 +266,464 @@ GetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_LENGTH: + case WINDOWINTERNAL_WINDOW: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_LENGTH, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_WINDOW, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetWindow(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_SELF: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SELF, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetSelf(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_NAVIGATOR: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_NAVIGATOR, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMNavigator* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetNavigator(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_SCREEN: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SCREEN, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMScreen* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetScreen(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_HISTORY: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_HISTORY, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMHistory* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetHistory(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_STATUSBAR: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_STATUSBAR, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMBarProp* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetStatusbar(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_DIRECTORIES: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_DIRECTORIES, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMBarProp* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetDirectories(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_CLOSED: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CLOSED, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRBool prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetClosed(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = BOOLEAN_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_CRYPTO: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CRYPTO, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMCrypto* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetCrypto(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_PKCS11: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PKCS11, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMPkcs11* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetPkcs11(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_OPENER: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OPENER, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetOpener(&prop); + if(NS_SUCCEEDED(rv)) { + // get the js object + nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_STATUS: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_STATUS, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsAutoString prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetStatus(prop); + if(NS_SUCCEEDED(rv)) { + nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_DEFAULTSTATUS: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_DEFAULTSTATUS, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsAutoString prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetDefaultStatus(prop); + if(NS_SUCCEEDED(rv)) { + nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_LOCATION: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_LOCATION, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetLocation(vp); + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_TITLE: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_TITLE, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + nsAutoString prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetTitle(prop); + if(NS_SUCCEEDED(rv)) { + nsJSUtils::nsConvertStringToJSVal(prop, cx, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_INNERWIDTH: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_INNERWIDTH, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetInnerWidth(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_INNERHEIGHT: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_INNERHEIGHT, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetInnerHeight(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_OUTERWIDTH: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OUTERWIDTH, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetOuterWidth(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_OUTERHEIGHT: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OUTERHEIGHT, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetOuterHeight(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_SCREENX: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SCREENX, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetScreenX(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_SCREENY: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SCREENY, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetScreenY(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_PAGEXOFFSET: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PAGEXOFFSET, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetPageXOffset(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_PAGEYOFFSET: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PAGEYOFFSET, PR_FALSE); + if (NS_SUCCEEDED(rv)) { + PRInt32 prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetPageYOffset(&prop); + if(NS_SUCCEEDED(rv)) { + *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + } + break; + } + case WINDOWINTERNAL_LENGTH: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_LENGTH, PR_FALSE); if (NS_SUCCEEDED(rv)) { PRUint32 prop; - rv = a->GetLength(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetLength(&prop); + if(NS_SUCCEEDED(rv)) { *vp = INT_TO_JSVAL(prop); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } } break; @@ -986,47 +1156,6 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) if (!secMan) return PR_FALSE; switch(JSVAL_TO_INT(id)) { - case WINDOW_OPENER: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OPENER, PR_TRUE); - if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; - if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop, - kIWindowIID, NS_ConvertASCIItoUCS2("Window"), - cx, *vp)) { - rv = NS_ERROR_DOM_NOT_OBJECT_ERR; - break; - } - - rv = a->SetOpener(prop); - NS_IF_RELEASE(prop); - } - break; - } - case WINDOW_STATUS: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_STATUS, PR_TRUE); - if (NS_SUCCEEDED(rv)) { - nsAutoString prop; - nsJSUtils::nsConvertJSValToString(prop, cx, *vp); - - rv = a->SetStatus(prop); - - } - break; - } - case WINDOW_DEFAULTSTATUS: - { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_DEFAULTSTATUS, PR_TRUE); - if (NS_SUCCEEDED(rv)) { - nsAutoString prop; - nsJSUtils::nsConvertJSValToString(prop, cx, *vp); - - rv = a->SetDefaultStatus(prop); - - } - break; - } case WINDOW_NAME: { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_NAME, PR_TRUE); @@ -1039,33 +1168,114 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) } break; } - case WINDOW_LOCATION: + case WINDOWINTERNAL_OPENER: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_LOCATION, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OPENER, PR_TRUE); if (NS_SUCCEEDED(rv)) { - jsval prop; - prop = *vp; + nsIDOMWindowInternal* prop; + if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop, + kIWindowInternalIID, NS_ConvertASCIItoUCS2("WindowInternal"), + cx, *vp)) { + rv = NS_ERROR_DOM_NOT_OBJECT_ERR; + break; + } - rv = a->SetLocation(prop); - + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetOpener(prop); + NS_RELEASE(b); + } + else { + NS_IF_RELEASE(prop); + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + NS_IF_RELEASE(prop); } break; } - case WINDOW_TITLE: + case WINDOWINTERNAL_STATUS: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_TITLE, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_STATUS, PR_TRUE); if (NS_SUCCEEDED(rv)) { nsAutoString prop; nsJSUtils::nsConvertJSValToString(prop, cx, *vp); - rv = a->SetTitle(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetStatus(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_INNERWIDTH: + case WINDOWINTERNAL_DEFAULTSTATUS: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_INNERWIDTH, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_DEFAULTSTATUS, PR_TRUE); + if (NS_SUCCEEDED(rv)) { + nsAutoString prop; + nsJSUtils::nsConvertJSValToString(prop, cx, *vp); + + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetDefaultStatus(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + + } + break; + } + case WINDOWINTERNAL_LOCATION: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_LOCATION, PR_TRUE); + if (NS_SUCCEEDED(rv)) { + jsval prop; + prop = *vp; + + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetLocation(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + + } + break; + } + case WINDOWINTERNAL_TITLE: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_TITLE, PR_TRUE); + if (NS_SUCCEEDED(rv)) { + nsAutoString prop; + nsJSUtils::nsConvertJSValToString(prop, cx, *vp); + + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetTitle(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } + + } + break; + } + case WINDOWINTERNAL_INNERWIDTH: + { + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_INNERWIDTH, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1077,14 +1287,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetInnerWidth(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetInnerWidth(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_INNERHEIGHT: + case WINDOWINTERNAL_INNERHEIGHT: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_INNERHEIGHT, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_INNERHEIGHT, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1096,14 +1314,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetInnerHeight(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetInnerHeight(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_OUTERWIDTH: + case WINDOWINTERNAL_OUTERWIDTH: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OUTERWIDTH, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OUTERWIDTH, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1115,14 +1341,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetOuterWidth(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetOuterWidth(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_OUTERHEIGHT: + case WINDOWINTERNAL_OUTERHEIGHT: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OUTERHEIGHT, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OUTERHEIGHT, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1134,14 +1368,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetOuterHeight(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetOuterHeight(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_SCREENX: + case WINDOWINTERNAL_SCREENX: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCREENX, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SCREENX, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1153,14 +1395,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetScreenX(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetScreenX(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_SCREENY: + case WINDOWINTERNAL_SCREENY: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCREENY, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SCREENY, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1172,14 +1422,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetScreenY(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetScreenY(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_PAGEXOFFSET: + case WINDOWINTERNAL_PAGEXOFFSET: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PAGEXOFFSET, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PAGEXOFFSET, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1191,14 +1449,22 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetPageXOffset(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetPageXOffset(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; } - case WINDOW_PAGEYOFFSET: + case WINDOWINTERNAL_PAGEYOFFSET: { - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PAGEYOFFSET, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PAGEYOFFSET, PR_TRUE); if (NS_SUCCEEDED(rv)) { PRInt32 prop; int32 temp; @@ -1210,7 +1476,15 @@ SetWindowProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) break; } - rv = a->SetPageYOffset(prop); + nsIDOMWindowInternal *b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + b->SetPageYOffset(prop); + NS_RELEASE(b); + } + else { + + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; + } } break; @@ -1788,9 +2062,9 @@ WindowtopSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // _content Property Getter // PR_STATIC_CALLBACK(JSBool) -Window_contentGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternal_contentGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1801,16 +2075,23 @@ Window_contentGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW__CONTENT, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL__CONTENT, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } - nsIDOMWindow* prop; - rv = a->Get_content(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* prop; + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->Get_content(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -1821,9 +2102,9 @@ Window_contentGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // _content Property Setter // PR_STATIC_CALLBACK(JSBool) -Window_contentSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternal_contentSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1834,7 +2115,7 @@ Window_contentSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW__CONTENT, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL__CONTENT, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -1849,9 +2130,9 @@ Window_contentSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // sidebar Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowsidebarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalsidebarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1862,16 +2143,23 @@ WindowsidebarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SIDEBAR, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SIDEBAR, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsISidebar* prop; - rv = a->GetSidebar(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetSidebar(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object; n.b., this will do a release on 'prop' nsJSUtils::nsConvertXPCObjectToJSVal(prop, NS_GET_IID(nsISidebar), cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -1882,9 +2170,9 @@ WindowsidebarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // sidebar Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowsidebarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalsidebarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1895,7 +2183,7 @@ WindowsidebarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SIDEBAR, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SIDEBAR, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -1910,9 +2198,9 @@ WindowsidebarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // prompter Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowprompterGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalprompterGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1923,16 +2211,23 @@ WindowprompterGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PROMPTER, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PROMPTER, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsIPrompt* prop; - rv = a->GetPrompter(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetPrompter(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object; n.b., this will do a release on 'prop' nsJSUtils::nsConvertXPCObjectToJSVal(prop, NS_GET_IID(nsIPrompt), cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -1943,9 +2238,9 @@ WindowprompterGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // prompter Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowprompterSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalprompterSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1956,7 +2251,7 @@ WindowprompterSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PROMPTER, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PROMPTER, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -1971,9 +2266,9 @@ WindowprompterSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // menubar Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowmenubarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalmenubarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -1984,16 +2279,23 @@ WindowmenubarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_MENUBAR, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_MENUBAR, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsIDOMBarProp* prop; - rv = a->GetMenubar(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetMenubar(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -2004,9 +2306,9 @@ WindowmenubarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // menubar Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowmenubarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalmenubarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2017,7 +2319,7 @@ WindowmenubarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_MENUBAR, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_MENUBAR, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -2032,9 +2334,9 @@ WindowmenubarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // toolbar Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowtoolbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternaltoolbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2045,16 +2347,23 @@ WindowtoolbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_TOOLBAR, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_TOOLBAR, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsIDOMBarProp* prop; - rv = a->GetToolbar(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetToolbar(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -2065,9 +2374,9 @@ WindowtoolbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // toolbar Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowtoolbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternaltoolbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2078,7 +2387,7 @@ WindowtoolbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_TOOLBAR, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_TOOLBAR, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -2093,9 +2402,9 @@ WindowtoolbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // locationbar Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowlocationbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternallocationbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2106,16 +2415,23 @@ WindowlocationbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_LOCATIONBAR, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_LOCATIONBAR, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsIDOMBarProp* prop; - rv = a->GetLocationbar(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetLocationbar(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -2126,9 +2442,9 @@ WindowlocationbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // locationbar Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowlocationbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternallocationbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2139,7 +2455,7 @@ WindowlocationbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_LOCATIONBAR, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_LOCATIONBAR, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -2154,9 +2470,9 @@ WindowlocationbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // personalbar Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowpersonalbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalpersonalbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2167,16 +2483,23 @@ WindowpersonalbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PERSONALBAR, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PERSONALBAR, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsIDOMBarProp* prop; - rv = a->GetPersonalbar(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetPersonalbar(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object nsJSUtils::nsConvertObjectToJSVal((nsISupports *)prop, cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -2187,9 +2510,9 @@ WindowpersonalbarGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // personalbar Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowpersonalbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalpersonalbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2200,7 +2523,7 @@ WindowpersonalbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PERSONALBAR, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PERSONALBAR, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -2215,9 +2538,9 @@ WindowpersonalbarSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // controllers Property Getter // PR_STATIC_CALLBACK(JSBool) -WindowcontrollersGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalcontrollersGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2228,16 +2551,23 @@ WindowcontrollersGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CONTROLLERS, PR_FALSE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CONTROLLERS, PR_FALSE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } nsIControllers* prop; - rv = a->GetControllers(&prop); - if (NS_SUCCEEDED(rv)) { + nsIDOMWindowInternal* b; + if (NS_OK == a->QueryInterface(kIWindowInternalIID, (void **)&b)) { + rv = b->GetControllers(&prop); + if(NS_SUCCEEDED(rv)) { // get the js object; n.b., this will do a release on 'prop' nsJSUtils::nsConvertXPCObjectToJSVal(prop, NS_GET_IID(nsIControllers), cx, obj, vp); + } + NS_RELEASE(b); + } + else { + rv = NS_ERROR_DOM_WRONG_TYPE_ERR; } return PR_TRUE; @@ -2248,9 +2578,9 @@ WindowcontrollersGetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) // controllers Property Setter // PR_STATIC_CALLBACK(JSBool) -WindowcontrollersSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) +WindowInternalcontrollersSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) { - nsIDOMWindow *a = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindowInternal *a = (nsIDOMWindowInternal*)nsJSUtils::nsGetNativeThis(cx, obj); // If there's no private data, this must be the prototype, so ignore if (nsnull == a) { @@ -2261,7 +2591,7 @@ WindowcontrollersSetter(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CONTROLLERS, PR_TRUE); + rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CONTROLLERS, PR_TRUE); if (NS_FAILED(rv)) { return nsJSUtils::nsReportError(cx, obj, rv); } @@ -2302,704 +2632,6 @@ ResolveWindow(JSContext *cx, JSObject *obj, jsval id) } -// -// Native method Dump -// -PR_STATIC_CALLBACK(JSBool) -WindowDump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - nsAutoString b0; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_DUMP, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - if (argc < 1) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); - } - - nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]); - - result = nativeThis->Dump(b0); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Alert -// -PR_STATIC_CALLBACK(JSBool) -WindowAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_ALERT, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Alert(cx, argv+0, argc-0); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Confirm -// -PR_STATIC_CALLBACK(JSBool) -WindowConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - PRBool nativeRet; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CONFIRM, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Confirm(cx, argv+0, argc-0, &nativeRet); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = BOOLEAN_TO_JSVAL(nativeRet); - } - - return JS_TRUE; -} - - -// -// Native method Prompt -// -PR_STATIC_CALLBACK(JSBool) -WindowPrompt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - jsval nativeRet; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PROMPT, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Prompt(cx, argv+0, argc-0, &nativeRet); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = nativeRet; - } - - return JS_TRUE; -} - - -// -// Native method Focus -// -PR_STATIC_CALLBACK(JSBool) -WindowFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_FOCUS, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Focus(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Blur -// -PR_STATIC_CALLBACK(JSBool) -WindowBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_BLUR, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Blur(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Back -// -PR_STATIC_CALLBACK(JSBool) -WindowBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_BACK, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Back(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Forward -// -PR_STATIC_CALLBACK(JSBool) -WindowForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_FORWARD, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Forward(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Home -// -PR_STATIC_CALLBACK(JSBool) -WindowHome(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_HOME, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Home(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Stop -// -PR_STATIC_CALLBACK(JSBool) -WindowStop(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_STOP, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Stop(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Print -// -PR_STATIC_CALLBACK(JSBool) -WindowPrint(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_PRINT, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->Print(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method MoveTo -// -PR_STATIC_CALLBACK(JSBool) -WindowMoveTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - PRInt32 b0; - PRInt32 b1; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_MOVETO, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - if (argc < 2) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); - } - - if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - - result = nativeThis->MoveTo(b0, b1); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method MoveBy -// -PR_STATIC_CALLBACK(JSBool) -WindowMoveBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - PRInt32 b0; - PRInt32 b1; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_MOVEBY, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - if (argc < 2) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); - } - - if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - - result = nativeThis->MoveBy(b0, b1); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method ResizeTo -// -PR_STATIC_CALLBACK(JSBool) -WindowResizeTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - PRInt32 b0; - PRInt32 b1; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_RESIZETO, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - if (argc < 2) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); - } - - if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - - result = nativeThis->ResizeTo(b0, b1); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method ResizeBy -// -PR_STATIC_CALLBACK(JSBool) -WindowResizeBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - PRInt32 b0; - PRInt32 b1; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_RESIZEBY, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - if (argc < 2) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); - } - - if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - - result = nativeThis->ResizeBy(b0, b1); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method SizeToContent -// -PR_STATIC_CALLBACK(JSBool) -WindowSizeToContent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SIZETOCONTENT, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->SizeToContent(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method GetAttention -// -PR_STATIC_CALLBACK(JSBool) -WindowGetAttention(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_GETATTENTION, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->GetAttention(); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - -// -// Native method Scroll -// -PR_STATIC_CALLBACK(JSBool) -WindowScroll(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - PRInt32 b0; - PRInt32 b1; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SCROLL, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - if (argc < 2) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); - } - - if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { - return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); - } - - result = nativeThis->Scroll(b0, b1); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - *rval = JSVAL_VOID; - } - - return JS_TRUE; -} - - // // Native method ScrollTo // @@ -3095,14 +2727,14 @@ WindowScrollBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva // -// Native method ClearTimeout +// Native method GetSelection // PR_STATIC_CALLBACK(JSBool) -WindowClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); nsresult result = NS_OK; - PRInt32 b0; + nsIDOMSelection* nativeRet; // If there's no private data, this must be the prototype, so ignore if (nsnull == nativeThis) { return JS_TRUE; @@ -3113,7 +2745,836 @@ WindowClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CLEARTIMEOUT, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_GETSELECTION, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->GetSelection(&nativeRet); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, obj, rval); + } + + return JS_TRUE; +} + + +// +// Native method Dump +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalDump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + nsAutoString b0; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_DUMP, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + if (argc < 1) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); + } + + nsJSUtils::nsConvertJSValToString(b0, cx, argv[0]); + + result = nativeThis->Dump(b0); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Alert +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalAlert(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_ALERT, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Alert(cx, argv+0, argc-0); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Confirm +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRBool nativeRet; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CONFIRM, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Confirm(cx, argv+0, argc-0, &nativeRet); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = BOOLEAN_TO_JSVAL(nativeRet); + } + + return JS_TRUE; +} + + +// +// Native method Prompt +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalPrompt(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + jsval nativeRet; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PROMPT, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Prompt(cx, argv+0, argc-0, &nativeRet); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = nativeRet; + } + + return JS_TRUE; +} + + +// +// Native method Focus +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalFocus(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_FOCUS, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Focus(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Blur +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalBlur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_BLUR, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Blur(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Back +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalBack(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_BACK, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Back(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Forward +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalForward(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_FORWARD, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Forward(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Home +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalHome(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_HOME, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Home(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Stop +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalStop(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_STOP, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Stop(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Print +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalPrint(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_PRINT, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->Print(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method MoveTo +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalMoveTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRInt32 b0; + PRInt32 b1; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_MOVETO, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + if (argc < 2) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); + } + + if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + + result = nativeThis->MoveTo(b0, b1); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method MoveBy +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalMoveBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRInt32 b0; + PRInt32 b1; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_MOVEBY, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + if (argc < 2) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); + } + + if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + + result = nativeThis->MoveBy(b0, b1); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method ResizeTo +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalResizeTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRInt32 b0; + PRInt32 b1; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_RESIZETO, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + if (argc < 2) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); + } + + if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + + result = nativeThis->ResizeTo(b0, b1); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method ResizeBy +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalResizeBy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRInt32 b0; + PRInt32 b1; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_RESIZEBY, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + if (argc < 2) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); + } + + if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + + result = nativeThis->ResizeBy(b0, b1); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method SizeToContent +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalSizeToContent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SIZETOCONTENT, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->SizeToContent(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method GetAttention +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalGetAttention(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_GETATTENTION, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + result = nativeThis->GetAttention(); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method Scroll +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalScroll(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRInt32 b0; + PRInt32 b1; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SCROLL, PR_FALSE); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + if (argc < 2) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR); + } + + if (!JS_ValueToInt32(cx, argv[0], (int32 *)&b0)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR); + } + + result = nativeThis->Scroll(b0, b1); + if (NS_FAILED(result)) { + return nsJSUtils::nsReportError(cx, obj, result); + } + + *rval = JSVAL_VOID; + } + + return JS_TRUE; +} + + +// +// Native method ClearTimeout +// +PR_STATIC_CALLBACK(JSBool) +WindowInternalClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; + nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + PRInt32 b0; + // If there's no private data, this must be the prototype, so ignore + if (!nativeThis) { + return JS_TRUE; + } + + { + *rval = JSVAL_NULL; + nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); + if (!secMan) + return PR_FALSE; + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CLEARTIMEOUT, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3141,13 +3602,18 @@ WindowClearTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval // Native method ClearInterval // PR_STATIC_CALLBACK(JSBool) -WindowClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + PRInt32 b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3156,7 +3622,7 @@ WindowClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CLEARINTERVAL, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CLEARINTERVAL, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3184,13 +3650,18 @@ WindowClearInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval // Native method SetTimeout // PR_STATIC_CALLBACK(JSBool) -WindowSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + PRInt32 nativeRet; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3199,7 +3670,7 @@ WindowSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SETTIMEOUT, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SETTIMEOUT, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3220,13 +3691,18 @@ WindowSetTimeout(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r // Native method SetInterval // PR_STATIC_CALLBACK(JSBool) -WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + PRInt32 nativeRet; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3235,7 +3711,7 @@ WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SETINTERVAL, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SETINTERVAL, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3256,13 +3732,18 @@ WindowSetInterval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval * // Native method CaptureEvents // PR_STATIC_CALLBACK(JSBool) -WindowCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + PRInt32 b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3271,7 +3752,7 @@ WindowCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CAPTUREEVENTS, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CAPTUREEVENTS, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3299,13 +3780,18 @@ WindowCaptureEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval // Native method ReleaseEvents // PR_STATIC_CALLBACK(JSBool) -WindowReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + PRInt32 b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3314,7 +3800,7 @@ WindowReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_RELEASEEVENTS, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_RELEASEEVENTS, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3342,13 +3828,18 @@ WindowReleaseEvents(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval // Native method RouteEvent // PR_STATIC_CALLBACK(JSBool) -WindowRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + nsCOMPtr b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3357,7 +3848,7 @@ WindowRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_ROUTEEVENT, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_ROUTEEVENT, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3389,12 +3880,17 @@ WindowRouteEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r // Native method EnableExternalCapture // PR_STATIC_CALLBACK(JSBool) -WindowEnableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalEnableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3403,7 +3899,7 @@ WindowEnableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *arg nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_ENABLEEXTERNALCAPTURE, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_ENABLEEXTERNALCAPTURE, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3424,12 +3920,17 @@ WindowEnableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *arg // Native method DisableExternalCapture // PR_STATIC_CALLBACK(JSBool) -WindowDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3438,7 +3939,7 @@ WindowDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *ar nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_DISABLEEXTERNALCAPTURE, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_DISABLEEXTERNALCAPTURE, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3459,13 +3960,18 @@ WindowDisableExternalCapture(JSContext *cx, JSObject *obj, uintN argc, jsval *ar // Native method SetCursor // PR_STATIC_CALLBACK(JSBool) -WindowSetCursor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalSetCursor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + nsAutoString b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3474,7 +3980,7 @@ WindowSetCursor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_SETCURSOR, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_SETCURSOR, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3500,13 +4006,18 @@ WindowSetCursor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rv // Native method Open // PR_STATIC_CALLBACK(JSBool) -WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; - nsIDOMWindow* nativeRet; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + nsIDOMWindowInternal* nativeRet; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3515,7 +4026,7 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OPEN, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OPEN, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3536,13 +4047,18 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) // Native method OpenDialog // PR_STATIC_CALLBACK(JSBool) -WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; - nsIDOMWindow* nativeRet; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + + nsIDOMWindowInternal* nativeRet; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3551,7 +4067,7 @@ WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_OPENDIALOG, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_OPENDIALOG, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3572,12 +4088,17 @@ WindowOpenDialog(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r // Native method Close // PR_STATIC_CALLBACK(JSBool) -WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3586,7 +4107,7 @@ WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_CLOSE, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_CLOSE, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3607,13 +4128,18 @@ WindowClose(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) // Native method UpdateCommands // PR_STATIC_CALLBACK(JSBool) -WindowUpdateCommands(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalUpdateCommands(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + nsAutoString b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3622,7 +4148,7 @@ WindowUpdateCommands(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_UPDATECOMMANDS, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_UPDATECOMMANDS, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3648,14 +4174,19 @@ WindowUpdateCommands(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva // Native method Escape // PR_STATIC_CALLBACK(JSBool) -WindowEscape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalEscape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + nsAutoString nativeRet; nsAutoString b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3664,7 +4195,7 @@ WindowEscape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_ESCAPE, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_ESCAPE, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3690,14 +4221,19 @@ WindowEscape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) // Native method Unescape // PR_STATIC_CALLBACK(JSBool) -WindowUnescape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +WindowInternalUnescape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsIDOMWindow *privateThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); + nsCOMPtr nativeThis; nsresult result = NS_OK; + if (NS_OK != privateThis->QueryInterface(kIWindowInternalIID, getter_AddRefs(nativeThis))) { + return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_WRONG_TYPE_ERR); + } + nsAutoString nativeRet; nsAutoString b0; // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { + if (!nativeThis) { return JS_TRUE; } @@ -3706,7 +4242,7 @@ WindowUnescape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); if (!secMan) return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_UNESCAPE, PR_FALSE); + result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOWINTERNAL_UNESCAPE, PR_FALSE); if (NS_FAILED(result)) { return nsJSUtils::nsReportError(cx, obj, result); } @@ -3728,42 +4264,6 @@ WindowUnescape(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rva } -// -// Native method GetSelection -// -PR_STATIC_CALLBACK(JSBool) -WindowGetSelection(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) -{ - nsIDOMWindow *nativeThis = (nsIDOMWindow*)nsJSUtils::nsGetNativeThis(cx, obj); - nsresult result = NS_OK; - nsIDOMSelection* nativeRet; - // If there's no private data, this must be the prototype, so ignore - if (nsnull == nativeThis) { - return JS_TRUE; - } - - { - *rval = JSVAL_NULL; - nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj); - if (!secMan) - return PR_FALSE; - result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_WINDOW_GETSELECTION, PR_FALSE); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - result = nativeThis->GetSelection(&nativeRet); - if (NS_FAILED(result)) { - return nsJSUtils::nsReportError(cx, obj, result); - } - - nsJSUtils::nsConvertObjectToJSVal(nativeRet, cx, obj, rval); - } - - return JS_TRUE; -} - - // // Native method AddEventListener // @@ -4010,46 +4510,46 @@ JSClass WindowClass = { // static JSPropertySpec WindowProperties[] = { - {"window", WINDOW_WINDOW, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"self", WINDOW_SELF, JSPROP_ENUMERATE | JSPROP_READONLY}, {"document", WINDOW_DOCUMENT, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"navigator", WINDOW_NAVIGATOR, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"screen", WINDOW_SCREEN, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"history", WINDOW_HISTORY, JSPROP_ENUMERATE | JSPROP_READONLY}, {"parent", WINDOW_PARENT, JSPROP_ENUMERATE | JSPROP_READONLY}, {"top", WINDOW_TOP, JSPROP_ENUMERATE, WindowtopGetter, WindowtopSetter}, - {"_content", WINDOW__CONTENT, JSPROP_ENUMERATE, Window_contentGetter, Window_contentSetter}, - {"sidebar", WINDOW_SIDEBAR, JSPROP_ENUMERATE, WindowsidebarGetter, WindowsidebarSetter}, - {"prompter", WINDOW_PROMPTER, JSPROP_ENUMERATE, WindowprompterGetter, WindowprompterSetter}, - {"menubar", WINDOW_MENUBAR, JSPROP_ENUMERATE, WindowmenubarGetter, WindowmenubarSetter}, - {"toolbar", WINDOW_TOOLBAR, JSPROP_ENUMERATE, WindowtoolbarGetter, WindowtoolbarSetter}, - {"locationbar", WINDOW_LOCATIONBAR, JSPROP_ENUMERATE, WindowlocationbarGetter, WindowlocationbarSetter}, - {"personalbar", WINDOW_PERSONALBAR, JSPROP_ENUMERATE, WindowpersonalbarGetter, WindowpersonalbarSetter}, - {"statusbar", WINDOW_STATUSBAR, JSPROP_ENUMERATE | JSPROP_READONLY}, {"scrollbars", WINDOW_SCROLLBARS, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"directories", WINDOW_DIRECTORIES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"closed", WINDOW_CLOSED, JSPROP_ENUMERATE | JSPROP_READONLY}, {"frames", WINDOW_FRAMES, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"crypto", WINDOW_CRYPTO, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"pkcs11", WINDOW_PKCS11, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"controllers", WINDOW_CONTROLLERS, JSPROP_ENUMERATE, WindowcontrollersGetter, WindowcontrollersSetter}, - {"opener", WINDOW_OPENER, JSPROP_ENUMERATE}, - {"status", WINDOW_STATUS, JSPROP_ENUMERATE}, - {"defaultStatus", WINDOW_DEFAULTSTATUS, JSPROP_ENUMERATE}, {"name", WINDOW_NAME, JSPROP_ENUMERATE}, - {"location", WINDOW_LOCATION, JSPROP_ENUMERATE}, - {"title", WINDOW_TITLE, JSPROP_ENUMERATE}, - {"innerWidth", WINDOW_INNERWIDTH, JSPROP_ENUMERATE}, - {"innerHeight", WINDOW_INNERHEIGHT, JSPROP_ENUMERATE}, - {"outerWidth", WINDOW_OUTERWIDTH, JSPROP_ENUMERATE}, - {"outerHeight", WINDOW_OUTERHEIGHT, JSPROP_ENUMERATE}, - {"screenX", WINDOW_SCREENX, JSPROP_ENUMERATE}, - {"screenY", WINDOW_SCREENY, JSPROP_ENUMERATE}, - {"pageXOffset", WINDOW_PAGEXOFFSET, JSPROP_ENUMERATE}, - {"pageYOffset", WINDOW_PAGEYOFFSET, JSPROP_ENUMERATE}, {"scrollX", WINDOW_SCROLLX, JSPROP_ENUMERATE | JSPROP_READONLY}, {"scrollY", WINDOW_SCROLLY, JSPROP_ENUMERATE | JSPROP_READONLY}, - {"length", WINDOW_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"window", WINDOWINTERNAL_WINDOW, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"self", WINDOWINTERNAL_SELF, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"navigator", WINDOWINTERNAL_NAVIGATOR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"screen", WINDOWINTERNAL_SCREEN, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"history", WINDOWINTERNAL_HISTORY, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"_content", WINDOWINTERNAL__CONTENT, JSPROP_ENUMERATE, WindowInternal_contentGetter, WindowInternal_contentSetter}, + {"sidebar", WINDOWINTERNAL_SIDEBAR, JSPROP_ENUMERATE, WindowInternalsidebarGetter, WindowInternalsidebarSetter}, + {"prompter", WINDOWINTERNAL_PROMPTER, JSPROP_ENUMERATE, WindowInternalprompterGetter, WindowInternalprompterSetter}, + {"menubar", WINDOWINTERNAL_MENUBAR, JSPROP_ENUMERATE, WindowInternalmenubarGetter, WindowInternalmenubarSetter}, + {"toolbar", WINDOWINTERNAL_TOOLBAR, JSPROP_ENUMERATE, WindowInternaltoolbarGetter, WindowInternaltoolbarSetter}, + {"locationbar", WINDOWINTERNAL_LOCATIONBAR, JSPROP_ENUMERATE, WindowInternallocationbarGetter, WindowInternallocationbarSetter}, + {"personalbar", WINDOWINTERNAL_PERSONALBAR, JSPROP_ENUMERATE, WindowInternalpersonalbarGetter, WindowInternalpersonalbarSetter}, + {"statusbar", WINDOWINTERNAL_STATUSBAR, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"directories", WINDOWINTERNAL_DIRECTORIES, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"closed", WINDOWINTERNAL_CLOSED, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"crypto", WINDOWINTERNAL_CRYPTO, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"pkcs11", WINDOWINTERNAL_PKCS11, JSPROP_ENUMERATE | JSPROP_READONLY}, + {"controllers", WINDOWINTERNAL_CONTROLLERS, JSPROP_ENUMERATE, WindowInternalcontrollersGetter, WindowInternalcontrollersSetter}, + {"opener", WINDOWINTERNAL_OPENER, JSPROP_ENUMERATE}, + {"status", WINDOWINTERNAL_STATUS, JSPROP_ENUMERATE}, + {"defaultStatus", WINDOWINTERNAL_DEFAULTSTATUS, JSPROP_ENUMERATE}, + {"location", WINDOWINTERNAL_LOCATION, JSPROP_ENUMERATE}, + {"title", WINDOWINTERNAL_TITLE, JSPROP_ENUMERATE}, + {"innerWidth", WINDOWINTERNAL_INNERWIDTH, JSPROP_ENUMERATE}, + {"innerHeight", WINDOWINTERNAL_INNERHEIGHT, JSPROP_ENUMERATE}, + {"outerWidth", WINDOWINTERNAL_OUTERWIDTH, JSPROP_ENUMERATE}, + {"outerHeight", WINDOWINTERNAL_OUTERHEIGHT, JSPROP_ENUMERATE}, + {"screenX", WINDOWINTERNAL_SCREENX, JSPROP_ENUMERATE}, + {"screenY", WINDOWINTERNAL_SCREENY, JSPROP_ENUMERATE}, + {"pageXOffset", WINDOWINTERNAL_PAGEXOFFSET, JSPROP_ENUMERATE}, + {"pageYOffset", WINDOWINTERNAL_PAGEYOFFSET, JSPROP_ENUMERATE}, + {"length", WINDOWINTERNAL_LENGTH, JSPROP_ENUMERATE | JSPROP_READONLY}, {"onmousedown", WINDOWEVENTOWNER_ONMOUSEDOWN, JSPROP_ENUMERATE}, {"onmouseup", WINDOWEVENTOWNER_ONMOUSEUP, JSPROP_ENUMERATE}, {"onclick", WINDOWEVENTOWNER_ONCLICK, JSPROP_ENUMERATE}, @@ -4084,43 +4584,43 @@ static JSPropertySpec WindowProperties[] = // static JSFunctionSpec WindowMethods[] = { - {"dump", WindowDump, 1}, - {"alert", WindowAlert, 0}, - {"confirm", WindowConfirm, 0}, - {"prompt", WindowPrompt, 0}, - {"focus", WindowFocus, 0}, - {"blur", WindowBlur, 0}, - {"back", WindowBack, 0}, - {"forward", WindowForward, 0}, - {"home", WindowHome, 0}, - {"stop", WindowStop, 0}, - {"print", WindowPrint, 0}, - {"moveTo", WindowMoveTo, 2}, - {"moveBy", WindowMoveBy, 2}, - {"resizeTo", WindowResizeTo, 2}, - {"resizeBy", WindowResizeBy, 2}, - {"sizeToContent", WindowSizeToContent, 0}, - {"GetAttention", WindowGetAttention, 0}, - {"scroll", WindowScroll, 2}, {"scrollTo", WindowScrollTo, 2}, {"scrollBy", WindowScrollBy, 2}, - {"clearTimeout", WindowClearTimeout, 1}, - {"clearInterval", WindowClearInterval, 1}, - {"setTimeout", WindowSetTimeout, 0}, - {"setInterval", WindowSetInterval, 0}, - {"captureEvents", WindowCaptureEvents, 1}, - {"releaseEvents", WindowReleaseEvents, 1}, - {"routeEvent", WindowRouteEvent, 1}, - {"enableExternalCapture", WindowEnableExternalCapture, 0}, - {"disableExternalCapture", WindowDisableExternalCapture, 0}, - {"setCursor", WindowSetCursor, 1}, - {"open", WindowOpen, 0}, - {"openDialog", WindowOpenDialog, 0}, - {"close", WindowClose, 0}, - {"updateCommands", WindowUpdateCommands, 1}, - {"escape", WindowEscape, 1}, - {"unescape", WindowUnescape, 1}, {"getSelection", WindowGetSelection, 0}, + {"dump", WindowInternalDump, 1}, + {"alert", WindowInternalAlert, 0}, + {"confirm", WindowInternalConfirm, 0}, + {"prompt", WindowInternalPrompt, 0}, + {"focus", WindowInternalFocus, 0}, + {"blur", WindowInternalBlur, 0}, + {"back", WindowInternalBack, 0}, + {"forward", WindowInternalForward, 0}, + {"home", WindowInternalHome, 0}, + {"stop", WindowInternalStop, 0}, + {"print", WindowInternalPrint, 0}, + {"moveTo", WindowInternalMoveTo, 2}, + {"moveBy", WindowInternalMoveBy, 2}, + {"resizeTo", WindowInternalResizeTo, 2}, + {"resizeBy", WindowInternalResizeBy, 2}, + {"sizeToContent", WindowInternalSizeToContent, 0}, + {"GetAttention", WindowInternalGetAttention, 0}, + {"scroll", WindowInternalScroll, 2}, + {"clearTimeout", WindowInternalClearTimeout, 1}, + {"clearInterval", WindowInternalClearInterval, 1}, + {"setTimeout", WindowInternalSetTimeout, 0}, + {"setInterval", WindowInternalSetInterval, 0}, + {"captureEvents", WindowInternalCaptureEvents, 1}, + {"releaseEvents", WindowInternalReleaseEvents, 1}, + {"routeEvent", WindowInternalRouteEvent, 1}, + {"enableExternalCapture", WindowInternalEnableExternalCapture, 0}, + {"disableExternalCapture", WindowInternalDisableExternalCapture, 0}, + {"setCursor", WindowInternalSetCursor, 1}, + {"open", WindowInternalOpen, 0}, + {"openDialog", WindowInternalOpenDialog, 0}, + {"close", WindowInternalClose, 0}, + {"updateCommands", WindowInternalUpdateCommands, 1}, + {"escape", WindowInternalEscape, 1}, + {"unescape", WindowInternalUnescape, 1}, {"addEventListener", EventTargetAddEventListener, 3}, {"removeEventListener", EventTargetRemoveEventListener, 3}, {"dispatchEvent", EventTargetDispatchEvent, 1}, diff --git a/dom/src/events/nsJSEvent.cpp b/dom/src/events/nsJSEvent.cpp index d6254e79352a..a18dedfbd67f 100644 --- a/dom/src/events/nsJSEvent.cpp +++ b/dom/src/events/nsJSEvent.cpp @@ -531,15 +531,15 @@ extern "C" NS_DOM nsresult NS_InitEventClass(nsIScriptContext *aContext, void ** if ((PR_TRUE == JS_LookupProperty(jscontext, global, "Event", &vp)) && JSVAL_IS_OBJECT(vp) && ((constructor = JSVAL_TO_OBJECT(vp)) != nsnull)) { - vp = INT_TO_JSVAL(nsIDOMEvent::BUBBLING_PHASE); - JS_SetProperty(jscontext, constructor, "BUBBLING_PHASE", &vp); - vp = INT_TO_JSVAL(nsIDOMEvent::CAPTURING_PHASE); JS_SetProperty(jscontext, constructor, "CAPTURING_PHASE", &vp); vp = INT_TO_JSVAL(nsIDOMEvent::AT_TARGET); JS_SetProperty(jscontext, constructor, "AT_TARGET", &vp); + vp = INT_TO_JSVAL(nsIDOMEvent::BUBBLING_PHASE); + JS_SetProperty(jscontext, constructor, "BUBBLING_PHASE", &vp); + vp = INT_TO_JSVAL(nsIDOMEvent::MOUSEDOWN); JS_SetProperty(jscontext, constructor, "MOUSEDOWN", &vp); diff --git a/dom/src/jsurl/nsJSProtocolHandler.cpp b/dom/src/jsurl/nsJSProtocolHandler.cpp index 690e86d12848..a38dc79164dd 100644 --- a/dom/src/jsurl/nsJSProtocolHandler.cpp +++ b/dom/src/jsurl/nsJSProtocolHandler.cpp @@ -45,7 +45,7 @@ #include "nsXPIDLString.h" #include "nsIByteArrayInputStream.h" #include "nsIWindowMediator.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID); @@ -183,7 +183,7 @@ nsEvaluateStringProxy::BringUpConsole() if (NS_FAILED(rv)) return rv; // Next, find out whether there's a console already open. - nsCOMPtr console; + nsCOMPtr console; rv = windowMediator->GetMostRecentWindow(NS_LITERAL_STRING("global:console"), getter_AddRefs(console)); if (NS_FAILED(rv)) return rv; @@ -214,7 +214,7 @@ nsEvaluateStringProxy::BringUpConsole() if (NS_FAILED(rv)) return rv; // Finally, QI global to nsIDOMWindow and open the console. - nsCOMPtr window = do_QueryInterface(global, &rv); + nsCOMPtr window = do_QueryInterface(global, &rv); NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE); JSContext *cx = (JSContext*) scriptContext->GetNativeContext(); diff --git a/dom/src/xul/nsJSXULCommandDispatcher.cpp b/dom/src/xul/nsJSXULCommandDispatcher.cpp index ee8f4ce812f2..e1d78b4d7df0 100644 --- a/dom/src/xul/nsJSXULCommandDispatcher.cpp +++ b/dom/src/xul/nsJSXULCommandDispatcher.cpp @@ -37,7 +37,7 @@ #include "nsIController.h" #include "nsIDOMElement.h" #include "nsIDOMXULCommandDispatcher.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIControllers.h" @@ -98,7 +98,7 @@ GetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_FOCUSEDWINDOW, PR_FALSE); if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; + nsIDOMWindowInternal* prop; rv = a->GetFocusedWindow(&prop); if (NS_SUCCEEDED(rv)) { // get the js object @@ -197,7 +197,7 @@ SetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_FOCUSEDWINDOW, PR_TRUE); if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; + nsIDOMWindowInternal* prop; if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop, kIWindowIID, NS_ConvertASCIItoUCS2("Window"), cx, *vp)) { diff --git a/editor/base/nsComposerCommands.cpp b/editor/base/nsComposerCommands.cpp index e1a64212519b..64f29a7f0085 100644 --- a/editor/base/nsComposerCommands.cpp +++ b/editor/base/nsComposerCommands.cpp @@ -31,7 +31,7 @@ #include "nsIDOMSelection.h" #include "nsIDOMNode.h" #include "nsIDOMElement.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIClipboard.h" @@ -57,7 +57,7 @@ nsBaseComposerCommand::GetInterfaceNode(const PRUnichar* nodeID, nsIEditorShell* *outNode = nsnull; NS_ASSERTION(editorShell, "Should have an editorShell here"); - nsCOMPtr webshellWindow; + nsCOMPtr webshellWindow; editorShell->GetWebShellWindow(getter_AddRefs(webshellWindow)); if (!webshellWindow) return NS_ERROR_FAILURE; @@ -946,7 +946,7 @@ nsRemoveStylesCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon if (NS_FAILED(rv)) return rv; // now get all the style buttons to update - nsCOMPtr contentWindow; + nsCOMPtr contentWindow; editorShell->GetContentWindow(getter_AddRefs(contentWindow)); if (contentWindow) contentWindow->UpdateCommands(NS_ConvertASCIItoUCS2("style")); diff --git a/editor/base/nsEditorShell.cpp b/editor/base/nsEditorShell.cpp index af5c43c09af3..ce7b4c358771 100644 --- a/editor/base/nsEditorShell.cpp +++ b/editor/base/nsEditorShell.cpp @@ -38,7 +38,7 @@ #include "nsIDOMHTMLDocument.h" #include "nsIDiskDocument.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMNode.h" #include "nsIDOMNodeList.h" #include "nsICSSLoader.h" @@ -618,7 +618,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; cwP->Focus(); @@ -639,7 +639,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; cwP->GetDocument(getter_AddRefs(domDoc)); //mContentWindow->GetDocument(getter_AddRefs(domDoc)); @@ -663,7 +663,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec NS_IMETHODIMP -nsEditorShell::SetContentWindow(nsIDOMWindow* aWin) +nsEditorShell::SetContentWindow(nsIDOMWindowInternal* aWin) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (!aWin) @@ -690,7 +690,7 @@ nsEditorShell::SetContentWindow(nsIDOMWindow* aWin) nsCOMPtr controllers; if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; cwP->GetControllers(getter_AddRefs(controllers)); //rv = mContentWindow->GetControllers(getter_AddRefs(controllers)); @@ -729,13 +729,13 @@ nsEditorShell::SetContentWindow(nsIDOMWindow* aWin) NS_IMETHODIMP -nsEditorShell::GetContentWindow(nsIDOMWindow * *aContentWindow) +nsEditorShell::GetContentWindow(nsIDOMWindowInternal * *aContentWindow) { NS_ENSURE_ARG_POINTER(aContentWindow); if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; @@ -745,7 +745,7 @@ nsEditorShell::GetContentWindow(nsIDOMWindow * *aContentWindow) NS_IMETHODIMP -nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin) +nsEditorShell::SetWebShellWindow(nsIDOMWindowInternal* aWin) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (!aWin) @@ -784,7 +784,7 @@ nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin) } NS_IMETHODIMP -nsEditorShell::GetWebShellWindow(nsIDOMWindow * *aWebShellWindow) +nsEditorShell::GetWebShellWindow(nsIDOMWindowInternal * *aWebShellWindow) { NS_ENSURE_ARG_POINTER(aWebShellWindow); NS_IF_ADDREF(*aWebShellWindow = mWebShellWindow); @@ -1603,7 +1603,7 @@ nsEditorShell::TransferDocumentStateListeners() } NS_IMETHODIMP -nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWindow* inCheckWindow, PRBool *aDidFind) +nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWindowInternal* inCheckWindow, PRBool *aDidFind) { if (!inCheckWindow) return NS_ERROR_NULL_POINTER; *aDidFind = PR_FALSE; @@ -1615,7 +1615,7 @@ nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWind nsFileURL fileURL(fileURLString); nsFileSpec fileSpec(fileURL); - nsCOMPtr contentWindow; + nsCOMPtr contentWindow; inCheckWindow->Get_content(getter_AddRefs(contentWindow)); if (contentWindow) { @@ -1701,7 +1701,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) PRBool retVal = PR_FALSE; if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; res = dialog->Prompt(cwP, captionStr.GetUnicode(), msgStr1.GetUnicode(), @@ -1854,7 +1854,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) fileWidget->SetDefaultString(fileName); nsFileDlgResults dialogResult; - // 1ST PARAM SHOULD BE nsIDOMWindow*, not nsIWidget* + // 1ST PARAM SHOULD BE nsIDOMWindowInternal*, not nsIWidget* dialogResult = fileWidget->PutFile(nsnull, promptString, docFileSpec); delete [] titles; delete [] filters; @@ -1945,7 +1945,7 @@ nsEditorShell::Print() } NS_IMETHODIMP -nsEditorShell::GetLocalFileURL(nsIDOMWindow *parent, const PRUnichar *filterType, PRUnichar **_retval) +nsEditorShell::GetLocalFileURL(nsIDOMWindowInternal *parent, const PRUnichar *filterType, PRUnichar **_retval) { nsAutoString FilterType(filterType); PRBool htmlFilter = FilterType.EqualsIgnoreCase("html"); @@ -2895,7 +2895,7 @@ nsEditorShell::DoFind(PRBool aFindNext) { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; rv = findComponent->CreateContext(cwP, nsnull, getter_AddRefs(mSearchContext)); } @@ -3038,7 +3038,7 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti PRInt32 buttonPressed = 0; if(!mContentWindow) return result; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return result; rv = dialog->DoDialog( cwP, block, "chrome://global/content/commonDialog.xul" ); block->GetInt( nsICommonDialogs::eButtonPressed, &buttonPressed ); @@ -3063,7 +3063,7 @@ nsEditorShell::Confirm(const nsString& aTitle, const nsString& aQuestion) { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; rv = dialog->Confirm(cwP, aTitle.GetUnicode(), aQuestion.GetUnicode(), &result); } @@ -3082,7 +3082,7 @@ nsEditorShell::AlertWithTitle(const PRUnichar *aTitle, const PRUnichar *aMsg) { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; rv = dialog->Alert(cwP, aTitle, aMsg); } @@ -3099,7 +3099,7 @@ nsEditorShell::Alert(const nsString& aTitle, const nsString& aMsg) { if(!mContentWindow) return; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return; rv = dialog->Alert(cwP, aTitle.GetUnicode(), aMsg.GetUnicode()); } @@ -5256,7 +5256,7 @@ nsEditorShell::DoControllerCommand(nsString& aCommand) if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; nsresult rv = cwP->GetControllers(getter_AddRefs(controllers)); if (NS_FAILED(rv)) return rv; diff --git a/editor/base/nsEditorShell.h b/editor/base/nsEditorShell.h index bf52d1fe5968..3ded2d7d89e7 100644 --- a/editor/base/nsEditorShell.h +++ b/editor/base/nsEditorShell.h @@ -53,7 +53,7 @@ class nsIDocShell; class nsIScriptContext; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDOMElement; class nsIDOMNode; class nsIURI; @@ -137,7 +137,7 @@ class nsEditorShell : public nsIEditorShell, const nsString *aYesString, const nsString *aNoString); // this returns an AddReffed nsIScriptContext. You must relase it. - nsIScriptContext* GetScriptContext(nsIDOMWindow * aWin); + nsIScriptContext* GetScriptContext(nsIDOMWindowInternal * aWin); // Get a string from the string bundle file void GetBundleString(const nsString& name, nsString &outString); @@ -197,8 +197,8 @@ class nsEditorShell : public nsIEditorShell, // so we need to track it separately PRBool mHTMLSourceMode; - nsIDOMWindow *mWebShellWindow; // weak reference - //nsIDOMWindow *mContentWindow; // weak reference + nsIDOMWindowInternal *mWebShellWindow; // weak reference + //nsIDOMWindowInternal *mContentWindow; // weak reference nsWeakPtr mContentWindow; // weak reference nsEditorParserObserver *mParserObserver; // we hold the owning ref to this. diff --git a/editor/base/nsInterfaceState.cpp b/editor/base/nsInterfaceState.cpp index d8e836618aee..e729a76558c3 100644 --- a/editor/base/nsInterfaceState.cpp +++ b/editor/base/nsInterfaceState.cpp @@ -35,7 +35,7 @@ #include "nsIDOMSelection.h" #include "nsIDOMAttr.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsITimer.h" #include "nsIEditor.h" @@ -308,7 +308,7 @@ nsresult nsInterfaceState::CallUpdateCommands(const nsString& aCommand) nsCOMPtr scriptGlobalObject; theDoc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); if (!domWindow) return NS_ERROR_FAILURE; mDOMWindow = domWindow; } diff --git a/editor/base/nsInterfaceState.h b/editor/base/nsInterfaceState.h index ef0ec703c496..c50e6640205a 100644 --- a/editor/base/nsInterfaceState.h +++ b/editor/base/nsInterfaceState.h @@ -115,7 +115,7 @@ protected: nsIHTMLEditor* mEditor; // the HTML editor nsIDOMDocument* mChromeDoc; // XUL document for the chrome area - nsIDOMWindow* mDOMWindow; // nsIDOMWindow used for calling UpdateCommands + nsIDOMWindowInternal* mDOMWindow; // nsIDOMWindowInternal used for calling UpdateCommands nsCOMPtr mUpdateTimer; diff --git a/editor/composer/src/nsComposerCommands.cpp b/editor/composer/src/nsComposerCommands.cpp index e1a64212519b..64f29a7f0085 100644 --- a/editor/composer/src/nsComposerCommands.cpp +++ b/editor/composer/src/nsComposerCommands.cpp @@ -31,7 +31,7 @@ #include "nsIDOMSelection.h" #include "nsIDOMNode.h" #include "nsIDOMElement.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIClipboard.h" @@ -57,7 +57,7 @@ nsBaseComposerCommand::GetInterfaceNode(const PRUnichar* nodeID, nsIEditorShell* *outNode = nsnull; NS_ASSERTION(editorShell, "Should have an editorShell here"); - nsCOMPtr webshellWindow; + nsCOMPtr webshellWindow; editorShell->GetWebShellWindow(getter_AddRefs(webshellWindow)); if (!webshellWindow) return NS_ERROR_FAILURE; @@ -946,7 +946,7 @@ nsRemoveStylesCommand::DoCommand(const PRUnichar *aCommand, nsISupports * refCon if (NS_FAILED(rv)) return rv; // now get all the style buttons to update - nsCOMPtr contentWindow; + nsCOMPtr contentWindow; editorShell->GetContentWindow(getter_AddRefs(contentWindow)); if (contentWindow) contentWindow->UpdateCommands(NS_ConvertASCIItoUCS2("style")); diff --git a/editor/composer/src/nsEditorShell.cpp b/editor/composer/src/nsEditorShell.cpp index af5c43c09af3..ce7b4c358771 100644 --- a/editor/composer/src/nsEditorShell.cpp +++ b/editor/composer/src/nsEditorShell.cpp @@ -38,7 +38,7 @@ #include "nsIDOMHTMLDocument.h" #include "nsIDiskDocument.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMNode.h" #include "nsIDOMNodeList.h" #include "nsICSSLoader.h" @@ -618,7 +618,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; cwP->Focus(); @@ -639,7 +639,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; cwP->GetDocument(getter_AddRefs(domDoc)); //mContentWindow->GetDocument(getter_AddRefs(domDoc)); @@ -663,7 +663,7 @@ nsresult nsEditorShell::GetDocumentEventReceiver(nsIDOMEventReceiver **aEventRec NS_IMETHODIMP -nsEditorShell::SetContentWindow(nsIDOMWindow* aWin) +nsEditorShell::SetContentWindow(nsIDOMWindowInternal* aWin) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (!aWin) @@ -690,7 +690,7 @@ nsEditorShell::SetContentWindow(nsIDOMWindow* aWin) nsCOMPtr controllers; if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; cwP->GetControllers(getter_AddRefs(controllers)); //rv = mContentWindow->GetControllers(getter_AddRefs(controllers)); @@ -729,13 +729,13 @@ nsEditorShell::SetContentWindow(nsIDOMWindow* aWin) NS_IMETHODIMP -nsEditorShell::GetContentWindow(nsIDOMWindow * *aContentWindow) +nsEditorShell::GetContentWindow(nsIDOMWindowInternal * *aContentWindow) { NS_ENSURE_ARG_POINTER(aContentWindow); if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; @@ -745,7 +745,7 @@ nsEditorShell::GetContentWindow(nsIDOMWindow * *aContentWindow) NS_IMETHODIMP -nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin) +nsEditorShell::SetWebShellWindow(nsIDOMWindowInternal* aWin) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (!aWin) @@ -784,7 +784,7 @@ nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin) } NS_IMETHODIMP -nsEditorShell::GetWebShellWindow(nsIDOMWindow * *aWebShellWindow) +nsEditorShell::GetWebShellWindow(nsIDOMWindowInternal * *aWebShellWindow) { NS_ENSURE_ARG_POINTER(aWebShellWindow); NS_IF_ADDREF(*aWebShellWindow = mWebShellWindow); @@ -1603,7 +1603,7 @@ nsEditorShell::TransferDocumentStateListeners() } NS_IMETHODIMP -nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWindow* inCheckWindow, PRBool *aDidFind) +nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWindowInternal* inCheckWindow, PRBool *aDidFind) { if (!inCheckWindow) return NS_ERROR_NULL_POINTER; *aDidFind = PR_FALSE; @@ -1615,7 +1615,7 @@ nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWind nsFileURL fileURL(fileURLString); nsFileSpec fileSpec(fileURL); - nsCOMPtr contentWindow; + nsCOMPtr contentWindow; inCheckWindow->Get_content(getter_AddRefs(contentWindow)); if (contentWindow) { @@ -1701,7 +1701,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) PRBool retVal = PR_FALSE; if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; res = dialog->Prompt(cwP, captionStr.GetUnicode(), msgStr1.GetUnicode(), @@ -1854,7 +1854,7 @@ nsEditorShell::SaveDocument(PRBool saveAs, PRBool saveCopy, PRBool *_retval) fileWidget->SetDefaultString(fileName); nsFileDlgResults dialogResult; - // 1ST PARAM SHOULD BE nsIDOMWindow*, not nsIWidget* + // 1ST PARAM SHOULD BE nsIDOMWindowInternal*, not nsIWidget* dialogResult = fileWidget->PutFile(nsnull, promptString, docFileSpec); delete [] titles; delete [] filters; @@ -1945,7 +1945,7 @@ nsEditorShell::Print() } NS_IMETHODIMP -nsEditorShell::GetLocalFileURL(nsIDOMWindow *parent, const PRUnichar *filterType, PRUnichar **_retval) +nsEditorShell::GetLocalFileURL(nsIDOMWindowInternal *parent, const PRUnichar *filterType, PRUnichar **_retval) { nsAutoString FilterType(filterType); PRBool htmlFilter = FilterType.EqualsIgnoreCase("html"); @@ -2895,7 +2895,7 @@ nsEditorShell::DoFind(PRBool aFindNext) { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; rv = findComponent->CreateContext(cwP, nsnull, getter_AddRefs(mSearchContext)); } @@ -3038,7 +3038,7 @@ nsEditorShell::ConfirmWithCancel(const nsString& aTitle, const nsString& aQuesti PRInt32 buttonPressed = 0; if(!mContentWindow) return result; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return result; rv = dialog->DoDialog( cwP, block, "chrome://global/content/commonDialog.xul" ); block->GetInt( nsICommonDialogs::eButtonPressed, &buttonPressed ); @@ -3063,7 +3063,7 @@ nsEditorShell::Confirm(const nsString& aTitle, const nsString& aQuestion) { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; rv = dialog->Confirm(cwP, aTitle.GetUnicode(), aQuestion.GetUnicode(), &result); } @@ -3082,7 +3082,7 @@ nsEditorShell::AlertWithTitle(const PRUnichar *aTitle, const PRUnichar *aMsg) { if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; rv = dialog->Alert(cwP, aTitle, aMsg); } @@ -3099,7 +3099,7 @@ nsEditorShell::Alert(const nsString& aTitle, const nsString& aMsg) { if(!mContentWindow) return; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return; rv = dialog->Alert(cwP, aTitle.GetUnicode(), aMsg.GetUnicode()); } @@ -5256,7 +5256,7 @@ nsEditorShell::DoControllerCommand(nsString& aCommand) if(!mContentWindow) return NS_ERROR_NOT_INITIALIZED; - nsCOMPtr cwP = do_QueryReferent(mContentWindow); + nsCOMPtr cwP = do_QueryReferent(mContentWindow); if (!cwP) return NS_ERROR_NOT_INITIALIZED; nsresult rv = cwP->GetControllers(getter_AddRefs(controllers)); if (NS_FAILED(rv)) return rv; diff --git a/editor/composer/src/nsEditorShell.h b/editor/composer/src/nsEditorShell.h index bf52d1fe5968..3ded2d7d89e7 100644 --- a/editor/composer/src/nsEditorShell.h +++ b/editor/composer/src/nsEditorShell.h @@ -53,7 +53,7 @@ class nsIDocShell; class nsIScriptContext; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDOMElement; class nsIDOMNode; class nsIURI; @@ -137,7 +137,7 @@ class nsEditorShell : public nsIEditorShell, const nsString *aYesString, const nsString *aNoString); // this returns an AddReffed nsIScriptContext. You must relase it. - nsIScriptContext* GetScriptContext(nsIDOMWindow * aWin); + nsIScriptContext* GetScriptContext(nsIDOMWindowInternal * aWin); // Get a string from the string bundle file void GetBundleString(const nsString& name, nsString &outString); @@ -197,8 +197,8 @@ class nsEditorShell : public nsIEditorShell, // so we need to track it separately PRBool mHTMLSourceMode; - nsIDOMWindow *mWebShellWindow; // weak reference - //nsIDOMWindow *mContentWindow; // weak reference + nsIDOMWindowInternal *mWebShellWindow; // weak reference + //nsIDOMWindowInternal *mContentWindow; // weak reference nsWeakPtr mContentWindow; // weak reference nsEditorParserObserver *mParserObserver; // we hold the owning ref to this. diff --git a/editor/composer/src/nsInterfaceState.cpp b/editor/composer/src/nsInterfaceState.cpp index d8e836618aee..e729a76558c3 100644 --- a/editor/composer/src/nsInterfaceState.cpp +++ b/editor/composer/src/nsInterfaceState.cpp @@ -35,7 +35,7 @@ #include "nsIDOMSelection.h" #include "nsIDOMAttr.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsITimer.h" #include "nsIEditor.h" @@ -308,7 +308,7 @@ nsresult nsInterfaceState::CallUpdateCommands(const nsString& aCommand) nsCOMPtr scriptGlobalObject; theDoc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); if (!domWindow) return NS_ERROR_FAILURE; mDOMWindow = domWindow; } diff --git a/editor/composer/src/nsInterfaceState.h b/editor/composer/src/nsInterfaceState.h index ef0ec703c496..c50e6640205a 100644 --- a/editor/composer/src/nsInterfaceState.h +++ b/editor/composer/src/nsInterfaceState.h @@ -115,7 +115,7 @@ protected: nsIHTMLEditor* mEditor; // the HTML editor nsIDOMDocument* mChromeDoc; // XUL document for the chrome area - nsIDOMWindow* mDOMWindow; // nsIDOMWindow used for calling UpdateCommands + nsIDOMWindowInternal* mDOMWindow; // nsIDOMWindowInternal used for calling UpdateCommands nsCOMPtr mUpdateTimer; diff --git a/editor/idl/nsIEditorShell.idl b/editor/idl/nsIEditorShell.idl index adfeb238e3f0..f37be46acdbc 100644 --- a/editor/idl/nsIEditorShell.idl +++ b/editor/idl/nsIEditorShell.idl @@ -29,7 +29,7 @@ %{C++ -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDOMDocument; class nsIDOMSelection; class nsIDOMElement; @@ -47,8 +47,8 @@ interface nsIEditorShell : nsISupports readonly attribute nsIDOMSelection editorSelection; readonly attribute nsISelectionController selectionController; - attribute nsIDOMWindow webShellWindow; - attribute nsIDOMWindow contentWindow; + attribute nsIDOMWindowInternal webShellWindow; + attribute nsIDOMWindowInternal contentWindow; attribute wstring editorType; [noscript] readonly attribute nsIEditor editor; @@ -132,7 +132,7 @@ interface nsIEditorShell : nsISupports in wstring yesButtonText, in wstring noButtonText); /* check a particular window's URL to see if it matches the given URL */ - boolean checkOpenWindowForURLMatch( in wstring inFileURL, in nsIDOMWindow inCheckWindow); + boolean checkOpenWindowForURLMatch( in wstring inFileURL, in nsIDOMWindowInternal inCheckWindow); /* Commands */ /** @@ -595,7 +595,7 @@ interface nsIEditorShell : nsISupports void DumpContentTree(); /* Utility */ - wstring GetLocalFileURL(in nsIDOMWindow parent, in wstring filterType); + wstring GetLocalFileURL(in nsIDOMWindowInternal parent, in wstring filterType); /** * Tests if a node is a BLOCK element according the the HTML 4.0 DTD diff --git a/embedding/browser/activex/src/control/MozillaBrowser.cpp b/embedding/browser/activex/src/control/MozillaBrowser.cpp index 7cd69abb269d..5af070a93997 100644 --- a/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -42,7 +42,7 @@ #include "nsIContentViewerFile.h" #include "nsISelectionController.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsEmbedAPI.h" @@ -1068,7 +1068,7 @@ HRESULT CMozillaBrowser::GetDOMDocument(nsIDOMDocument **pDocument) } // Get the DOM window from the webbrowser - nsCOMPtr window(do_GetInterface(mWebBrowser)); + nsCOMPtr window(do_GetInterface(mWebBrowser)); if (window) { if (NS_SUCCEEDED(window->GetDocument(pDocument)) && *pDocument) diff --git a/extensions/psm-glue/public/nsISecureBrowserUI.idl b/extensions/psm-glue/public/nsISecureBrowserUI.idl index 89eb2d7e19fe..d7dccca70b35 100644 --- a/extensions/psm-glue/public/nsISecureBrowserUI.idl +++ b/extensions/psm-glue/public/nsISecureBrowserUI.idl @@ -24,13 +24,13 @@ #include "nsISupports.idl" -interface nsIDOMWindow; +interface nsIDOMWindowInternal; interface nsIDOMElement; [scriptable, uuid(081e31e0-a144-11d3-8c7c-00609792278c)] interface nsSecureBrowserUI : nsISupports { - void init(in nsIDOMWindow window, in nsIDOMElement button, in nsIDOMElement certauth); + void init(in nsIDOMWindowInternal window, in nsIDOMElement button, in nsIDOMElement certauth); void displayPageInfoUI(); }; diff --git a/extensions/psm-glue/src/nsCrypto.cpp b/extensions/psm-glue/src/nsCrypto.cpp index c652739ce4f7..5c3c97b3a3dd 100644 --- a/extensions/psm-glue/src/nsCrypto.cpp +++ b/extensions/psm-glue/src/nsCrypto.cpp @@ -28,7 +28,7 @@ #include "nsPSMComponent.h" #include "nsDOMCID.h" #include "nsIDOMScriptObjectFactory.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIEventQueueService.h" #include "nsIEventQueue.h" #include "nsIThreadManager.h" @@ -1134,7 +1134,7 @@ nsCrypto::SignText(JSContext *cx, jsval *argv, PRUint32 argc, void alertUser(char *message) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext *jsContext; nsresult rv; @@ -1417,7 +1417,7 @@ nsPkcs11::GetScriptObject(nsIScriptContext *aContext, PRBool confirm_user(char *message) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext *jsContext; PRBool confirmation = PR_FALSE; nsresult rv; diff --git a/extensions/psm-glue/src/nsPSMUICallbacks.cpp b/extensions/psm-glue/src/nsPSMUICallbacks.cpp index 89cb38f890da..ef1bed26a97d 100644 --- a/extensions/psm-glue/src/nsPSMUICallbacks.cpp +++ b/extensions/psm-glue/src/nsPSMUICallbacks.cpp @@ -39,7 +39,7 @@ // Interfaces Needed #include "nsIAppShellService.h" #include "nsIDocShell.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIInterfaceRequestor.h" #include "nsIPrompt.h" #include "nsIScriptGlobalObject.h" @@ -68,7 +68,7 @@ NS_METHOD nsPSMUIHandlerImpl::DisplayURI(PRInt32 width, PRInt32 height, PRBool modal, const char *urlStr, nsIDOMWindow * win) { nsresult rv; - nsCOMPtr parentWindow; + nsCOMPtr parentWindow; JSContext *jsContext; jsval *argv = NULL; @@ -87,7 +87,7 @@ nsPSMUIHandlerImpl::DisplayURI(PRInt32 width, PRInt32 height, PRBool modal, cons jsContext = (JSContext*)scriptContext->GetNativeContext(); if (!jsContext) { rv = NS_ERROR_FAILURE; goto loser; } - parentWindow = win; + parentWindow = do_QueryInterface(win); } else { NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv); if (NS_FAILED(rv)) { @@ -120,7 +120,7 @@ nsPSMUIHandlerImpl::DisplayURI(PRInt32 width, PRInt32 height, PRBool modal, cons argv = JS_PushArguments(jsContext, &stackPtr, "sss", urlStr, "_blank", buffer); if (argv) { // open the window - nsIDOMWindow *newWindow; + nsIDOMWindowInternal *newWindow; parentWindow->Open(jsContext, argv, 3, &newWindow); newWindow->ResizeTo(width, height); JS_PopArguments(jsContext, stackPtr); diff --git a/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp b/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp index dfacec1bf1d8..c9018d512f61 100644 --- a/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp +++ b/extensions/psm-glue/src/nsSecureBrowserUIImpl.cpp @@ -45,7 +45,7 @@ #include "nsIDOMHTMLDocument.h" #include "nsIDOMXULDocument.h" #include "nsIDOMElement.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIContent.h" #include "nsIWebProgress.h" #include "nsIChannel.h" @@ -153,7 +153,7 @@ NS_IMPL_ISUPPORTS4(nsSecureBrowserUIImpl, NS_IMETHODIMP -nsSecureBrowserUIImpl::Init(nsIDOMWindow *window, nsIDOMElement *button, nsIDOMElement *certauth) +nsSecureBrowserUIImpl::Init(nsIDOMWindowInternal *window, nsIDOMElement *button, nsIDOMElement *certauth) { mSecurityButton = button; mCertificateAuthorityDisplay = certauth; @@ -247,7 +247,7 @@ static nsresult IsChildOfDomWindow(nsIDOMWindow *parent, nsIDOMWindow *child, PR NS_IMETHODIMP -nsSecureBrowserUIImpl::Notify(nsIContent* formNode, nsIDOMWindow* window, nsIURI* actionURL) +nsSecureBrowserUIImpl::Notify(nsIContent* formNode, nsIDOMWindowInternal* window, nsIURI* actionURL) { // Return NS_OK unless we want to prevent this form from submitting. @@ -261,7 +261,7 @@ nsSecureBrowserUIImpl::Notify(nsIContent* formNode, nsIDOMWindow* window, nsIURI nsCOMPtr globalObject; document->GetScriptGlobalObject(getter_AddRefs(globalObject)); - nsCOMPtr postingWindow = do_QueryInterface(globalObject); + nsCOMPtr postingWindow = do_QueryInterface(globalObject); PRBool isChild; IsChildOfDomWindow(mWindow, postingWindow, &isChild); diff --git a/extensions/psm-glue/src/nsSecureBrowserUIImpl.h b/extensions/psm-glue/src/nsSecureBrowserUIImpl.h index fa5f75373b86..95f00eb8f487 100644 --- a/extensions/psm-glue/src/nsSecureBrowserUIImpl.h +++ b/extensions/psm-glue/src/nsSecureBrowserUIImpl.h @@ -31,7 +31,7 @@ #include "nsIObserver.h" #include "nsIDocumentLoaderObserver.h" #include "nsIDOMElement.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIStringBundle.h" #include "nsISecureBrowserUI.h" #include "nsIDocShell.h" @@ -68,11 +68,11 @@ public: // nsIObserver NS_DECL_NSIOBSERVER - NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindow* window, nsIURI *actionURL); + NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindowInternal* window, nsIURI *actionURL); protected: - nsCOMPtr mWindow; + nsCOMPtr mWindow; nsCOMPtr mSecurityButton; nsCOMPtr mCertificateAuthorityDisplay; nsCOMPtr mOldWebShellObserver; diff --git a/extensions/xmlterm/base/mozIXMLTermShell.idl b/extensions/xmlterm/base/mozIXMLTermShell.idl index 78a84a6b63f0..181395d14dec 100644 --- a/extensions/xmlterm/base/mozIXMLTermShell.idl +++ b/extensions/xmlterm/base/mozIXMLTermShell.idl @@ -27,7 +27,7 @@ %{C++ class nsILineTerm; -class nsIDOMWindow; +class nsIDOMWindowInternal; %} [scriptable, uuid(0eb82b30-43a2-11d3-8e76-006008948af5)] @@ -43,7 +43,7 @@ interface mozIXMLTermShell : nsISupports * @param args argument string to be passed to XMLterm * (at the moment this just contains any initial input data) */ - void Init(in nsIDOMWindow aContentWin, in wstring URL, in wstring args); + void Init(in nsIDOMWindowInternal aContentWin, in wstring URL, in wstring args); /** Closes XMLterm, freeing resources * @param aCookie document.cookie string for authentication diff --git a/extensions/xmlterm/base/mozIXMLTermStream.h b/extensions/xmlterm/base/mozIXMLTermStream.h index b61f49ed4147..a0c39a88533b 100644 --- a/extensions/xmlterm/base/mozIXMLTermStream.h +++ b/extensions/xmlterm/base/mozIXMLTermStream.h @@ -55,7 +55,7 @@ class mozIXMLTermStream : public nsIInputStream * @param maxResizeHeight maximum resize height (0=> do not resize) * @return NS_OK on success */ - NS_IMETHOD Open(nsIDOMWindow* aDOMWindow, + NS_IMETHOD Open(nsIDOMWindowInternal* aDOMWindow, const char* frameName, const char* contentURL, const char* contentType, diff --git a/extensions/xmlterm/base/mozXMLTermSession.cpp b/extensions/xmlterm/base/mozXMLTermSession.cpp index c7346ae51bd9..3ba9d0f00c8a 100644 --- a/extensions/xmlterm/base/mozXMLTermSession.cpp +++ b/extensions/xmlterm/base/mozXMLTermSession.cpp @@ -1361,7 +1361,7 @@ NS_IMETHODIMP mozXMLTermSession::InitStream(const nsString& streamURL, if (NS_FAILED(result) || !docShell) return NS_ERROR_FAILURE; - nsCOMPtr outerDOMWindow; + nsCOMPtr outerDOMWindow; result = mozXMLTermUtils::ConvertDocShellToDOMWindow(docShell, getter_AddRefs(outerDOMWindow)); @@ -2877,7 +2877,7 @@ NS_IMETHODIMP mozXMLTermSession::ScrollToBottomLeft(void) if (NS_FAILED(result) || !docShell) return NS_ERROR_FAILURE; - nsCOMPtr domWindow; + nsCOMPtr domWindow; result = mozXMLTermUtils::ConvertDocShellToDOMWindow(docShell, getter_AddRefs(domWindow)); diff --git a/extensions/xmlterm/base/mozXMLTermShell.cpp b/extensions/xmlterm/base/mozXMLTermShell.cpp index 7a766c56860d..66a95e9611e4 100644 --- a/extensions/xmlterm/base/mozXMLTermShell.cpp +++ b/extensions/xmlterm/base/mozXMLTermShell.cpp @@ -46,7 +46,7 @@ #include "nsIDOMDocument.h" #include "nsIDOMSelection.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "mozXMLT.h" #include "mozXMLTermUtils.h" @@ -210,7 +210,7 @@ NS_IMETHODIMP mozXMLTermShell::IgnoreKeyPress(PRBool aIgnore, // Initialize XMLTermShell NS_IMETHODIMP -mozXMLTermShell::Init(nsIDOMWindow* aContentWin, +mozXMLTermShell::Init(nsIDOMWindowInternal* aContentWin, const PRUnichar* URL, const PRUnichar* args) { diff --git a/extensions/xmlterm/base/mozXMLTermShell.h b/extensions/xmlterm/base/mozXMLTermShell.h index 4cde63f013e1..1932c8913187 100644 --- a/extensions/xmlterm/base/mozXMLTermShell.h +++ b/extensions/xmlterm/base/mozXMLTermShell.h @@ -55,7 +55,7 @@ class mozXMLTermShell : public mozIXMLTermShell NS_IMETHOD IgnoreKeyPress(PRBool aIgnore, const PRUnichar* aCookie); - NS_IMETHOD Init(nsIDOMWindow* aContentWin, + NS_IMETHOD Init(nsIDOMWindowInternal* aContentWin, const PRUnichar* URL, const PRUnichar* args); @@ -77,7 +77,7 @@ protected: PRBool mInitialized; /** non-owning reference to content window for XMLterm */ - nsIDOMWindow* mContentWindow; + nsIDOMWindowInternal* mContentWindow; /** non-owning reference (??) to doc shell for content window */ nsIDocShell* mContentAreaDocShell; diff --git a/extensions/xmlterm/base/mozXMLTermStream.cpp b/extensions/xmlterm/base/mozXMLTermStream.cpp index 5d9ba6ec4436..470a58317449 100644 --- a/extensions/xmlterm/base/mozXMLTermStream.cpp +++ b/extensions/xmlterm/base/mozXMLTermStream.cpp @@ -46,7 +46,7 @@ #include "nsIScriptContextOwner.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowCollection.h" #include "nsIDOMElement.h" #include "nsIDOMNode.h" @@ -158,7 +158,7 @@ mozXMLTermStream::QueryInterface(REFNSIID aIID,void** aInstancePtr) * @param maxResizeHeight maximum resize height (0=> do not resize) * @return NS_OK on success */ -NS_IMETHODIMP mozXMLTermStream::Open(nsIDOMWindow* aDOMWindow, +NS_IMETHODIMP mozXMLTermStream::Open(nsIDOMWindowInternal* aDOMWindow, const char* frameName, const char* contentURL, const char* contentType, @@ -227,7 +227,7 @@ NS_IMETHODIMP mozXMLTermStream::Open(nsIDOMWindow* aDOMWindow, } // Get inner DOM window by looking up the frames list - nsCOMPtr innerDOMWindow; + nsCOMPtr innerDOMWindow; result = mozXMLTermUtils::GetInnerDOMWindow(aDOMWindow, innerFrameName, getter_AddRefs(innerDOMWindow)); if (NS_FAILED(result) || !innerDOMWindow) diff --git a/extensions/xmlterm/base/mozXMLTermStream.h b/extensions/xmlterm/base/mozXMLTermStream.h index 20587e3b9bae..ce69981980e3 100644 --- a/extensions/xmlterm/base/mozXMLTermStream.h +++ b/extensions/xmlterm/base/mozXMLTermStream.h @@ -46,7 +46,7 @@ class mozXMLTermStream : public mozIXMLTermStream // mozIXMLTermStream interface // Open stream in specified frame, or in current frame if frameName is null - NS_IMETHOD Open(nsIDOMWindow* aDOMWindow, + NS_IMETHOD Open(nsIDOMWindowInternal* aDOMWindow, const char* frameName, const char* contentURL, const char* contentType, @@ -73,7 +73,7 @@ class mozXMLTermStream : public mozIXMLTermStream PRInt32 mMaxResizeHeight; /** DOM window in which to display stream */ - nsCOMPtr mDOMWindow; + nsCOMPtr mDOMWindow; /** Frame element in which to display stream */ nsCOMPtr mDOMIFrameElement; diff --git a/extensions/xmlterm/base/mozXMLTermUtils.cpp b/extensions/xmlterm/base/mozXMLTermUtils.cpp index 7d836c40ed4d..f0ab0dc7ef27 100644 --- a/extensions/xmlterm/base/mozXMLTermUtils.cpp +++ b/extensions/xmlterm/base/mozXMLTermUtils.cpp @@ -53,7 +53,7 @@ */ NS_EXPORT nsresult mozXMLTermUtils::ConvertDocShellToDOMWindow(nsIDocShell* aDocShell, - nsIDOMWindow** aDOMWindow) + nsIDOMWindowInternal** aDOMWindow) { XMLT_LOG(mozXMLTermUtils::ConvertDocShellToDOMWindow,30,("\n")); @@ -64,7 +64,7 @@ mozXMLTermUtils::ConvertDocShellToDOMWindow(nsIDocShell* aDocShell, nsCOMPtr scriptGlobalObject(do_GetInterface(aDocShell)); - nsCOMPtr domWindow(do_QueryInterface(scriptGlobalObject)); + nsCOMPtr domWindow(do_QueryInterface(scriptGlobalObject)); if (!domWindow) return NS_ERROR_FAILURE; @@ -81,7 +81,7 @@ mozXMLTermUtils::ConvertDocShellToDOMWindow(nsIDocShell* aDocShell, * @return NS_OK on success */ NS_EXPORT nsresult -mozXMLTermUtils::ConvertDOMWindowToDocShell(nsIDOMWindow* aDOMWindow, +mozXMLTermUtils::ConvertDOMWindowToDocShell(nsIDOMWindowInternal* aDOMWindow, nsIDocShell** aDocShell) { XMLT_LOG(mozXMLTermUtils::ConvertDOMWindowToDocShell,30,("\n")); @@ -106,9 +106,9 @@ mozXMLTermUtils::ConvertDOMWindowToDocShell(nsIDOMWindow* aDOMWindow, * @return NS_OK on success */ NS_EXPORT nsresult -mozXMLTermUtils::GetInnerDOMWindow(nsIDOMWindow* outerDOMWindow, +mozXMLTermUtils::GetInnerDOMWindow(nsIDOMWindowInternal* outerDOMWindow, const nsString& innerFrameName, - nsIDOMWindow** innerDOMWindow) + nsIDOMWindowInternal** innerDOMWindow) { nsresult result; diff --git a/extensions/xmlterm/base/mozXMLTermUtils.h b/extensions/xmlterm/base/mozXMLTermUtils.h index aaa72ce7584a..b23ac8987089 100644 --- a/extensions/xmlterm/base/mozXMLTermUtils.h +++ b/extensions/xmlterm/base/mozXMLTermUtils.h @@ -29,7 +29,7 @@ #include "nsString.h" #include "nsIDocShell.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" class mozXMLTermUtils @@ -43,7 +43,7 @@ class mozXMLTermUtils */ static NS_EXPORT nsresult ConvertDocShellToDOMWindow(nsIDocShell* aDocShell, - nsIDOMWindow** aDOMWindow); + nsIDOMWindowInternal** aDOMWindow); /** Gets doc shell for DOM window * @param aDOMWindow DOM window (frame) @@ -51,7 +51,7 @@ class mozXMLTermUtils * @return NS_OK on success */ static NS_EXPORT nsresult - ConvertDOMWindowToDocShell(nsIDOMWindow* aDOMWindow, + ConvertDOMWindowToDocShell(nsIDOMWindowInternal* aDOMWindow, nsIDocShell** aDocShell); /** Locates named inner DOM window (frame) inside outer DOM window @@ -61,9 +61,9 @@ class mozXMLTermUtils * @return NS_OK on success */ static NS_EXPORT nsresult - GetInnerDOMWindow(nsIDOMWindow* outerDOMWindow, + GetInnerDOMWindow(nsIDOMWindowInternal* outerDOMWindow, const nsString& innerFrameName, - nsIDOMWindow** innerDOMWindow); + nsIDOMWindowInternal** innerDOMWindow); /** Gets the scrollable view for presentation context * @param aPresContext presentation context diff --git a/extensions/xmlterm/base/mozXMLTerminal.cpp b/extensions/xmlterm/base/mozXMLTerminal.cpp index 6cbe3ac00b6b..374fa797dca2 100644 --- a/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -377,7 +377,7 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void) return result; } - nsCOMPtr outerDOMWindow; + nsCOMPtr outerDOMWindow; result = mozXMLTermUtils::ConvertDocShellToDOMWindow(mDocShell, getter_AddRefs(outerDOMWindow)); diff --git a/gfx/src/gtk/nsDeviceContextSpecG.cpp b/gfx/src/gtk/nsDeviceContextSpecG.cpp index 7391bdf8658e..01021f525d49 100644 --- a/gfx/src/gtk/nsDeviceContextSpecG.cpp +++ b/gfx/src/gtk/nsDeviceContextSpecG.cpp @@ -29,7 +29,7 @@ #include "prenv.h" /* for PR_GetEnv */ #include "nsIAppShellComponentImpl.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIServiceManager.h" #include "nsIDialogParamBlock.h" #include "nsINetSupportDialogService.h" @@ -144,8 +144,8 @@ NS_IMETHODIMP nsDeviceContextSpecGTK :: Init(PRBool aQuiet) if (NS_SUCCEEDED(rv)) { NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv); if (NS_SUCCEEDED(rv)) { - nsCOMPtr hiddenWindow; - nsCOMPtr mWindow; + nsCOMPtr hiddenWindow; + nsCOMPtr mWindow; JSContext *jsContext; rv = appShell->GetHiddenWindowAndJSContext(getter_AddRefs(hiddenWindow), &jsContext); @@ -160,7 +160,7 @@ NS_IMETHODIMP nsDeviceContextSpecGTK :: Init(PRBool aQuiet) (const nsIID *) (&NS_GET_IID(nsIDialogParamBlock)), (nsISupports *) ioParamBlock); if (argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog(jsContext, argv, diff --git a/gfx/src/xlib/nsDeviceContextSpecXlib.cpp b/gfx/src/xlib/nsDeviceContextSpecXlib.cpp index 6012f09e8f1f..bcdeb0080a2a 100644 --- a/gfx/src/xlib/nsDeviceContextSpecXlib.cpp +++ b/gfx/src/xlib/nsDeviceContextSpecXlib.cpp @@ -29,7 +29,7 @@ #include "prenv.h" /* for PR_GetEnv */ #include "nsIAppShellComponentImpl.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIServiceManager.h" #include "nsIDialogParamBlock.h" #include "nsINetSupportDialogService.h" @@ -122,8 +122,8 @@ NS_IMETHODIMP nsDeviceContextSpecXlib::Init(PRBool aQuiet) if (NS_SUCCEEDED(rv)) { NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv); if (NS_SUCCEEDED(rv)) { - nsCOMPtr hiddenWindow; - nsCOMPtr mWindow; + nsCOMPtr hiddenWindow; + nsCOMPtr mWindow; JSContext *jsContext; rv = appShell->GetHiddenWindowAndJSContext(getter_AddRefs(hiddenWindow), &jsContext); @@ -138,7 +138,7 @@ NS_IMETHODIMP nsDeviceContextSpecXlib::Init(PRBool aQuiet) (const nsIID *) (&NS_GET_IID(nsIDialogParamBlock)), (nsISupports *) ioParamBlock); if (argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog(jsContext, argv, diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index c429b7332d0e..fae6b207f0fd 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -80,7 +80,7 @@ #include "nsIBindingManager.h" #include "nsIXBLBinding.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #ifdef INCLUDE_XUL #include "nsIDOMXULCommandDispatcher.h" diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 2537fca190d8..e2d145a48591 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -27,7 +27,7 @@ #include "nsIContent.h" #include "nsIContentViewerContainer.h" #include "nsIDocumentViewer.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIImageGroup.h" #include "nsIImageObserver.h" @@ -1838,7 +1838,7 @@ NS_IMETHODIMP nsDocViwerSelectionListener::NotifySelectionChanged(nsIDOMDocument nsCOMPtr scriptGlobalObject; theDoc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); if (!domWindow) return NS_ERROR_FAILURE; domWindow->UpdateCommands(NS_ConvertToString("select")); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 6c9b8988cae3..bbd8369d8cd0 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -107,7 +107,7 @@ #include "nsIReflowCallback.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #ifdef INCLUDE_XUL #include "nsIDOMXULDocument.h" @@ -1540,7 +1540,7 @@ static void CheckForFocus(nsIDocument* aDocument) // of the command dispatcher moves into the embedding layer. nsCOMPtr globalObject; aDocument->GetScriptGlobalObject(getter_AddRefs(globalObject)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(globalObject); ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); nsCOMPtr rootDocument; @@ -1554,7 +1554,7 @@ static void CheckForFocus(nsIDocument* aDocument) if (commandDispatcher) { // Suppress the command dispatcher. commandDispatcher->SetSuppressFocus(PR_TRUE); - nsCOMPtr focusedWindow; + nsCOMPtr focusedWindow; commandDispatcher->GetFocusedWindow(getter_AddRefs(focusedWindow)); // See if the command dispatcher is holding on to an orphan window. @@ -1571,7 +1571,7 @@ static void CheckForFocus(nsIDocument* aDocument) } } - nsCOMPtr domWindow = do_QueryInterface(ourWindow); + nsCOMPtr domWindow = do_QueryInterface(ourWindow); if (domWindow == focusedWindow) { PRBool active; commandDispatcher->GetActive(&active); @@ -1951,7 +1951,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame){ nsCOMPtr commandDispatcher; nsCOMPtr ourGlobal; document->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -2721,7 +2721,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, nsCOMPtr commandDispatcher; nsCOMPtr ourGlobal; document->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -2971,7 +2971,7 @@ PresShell::DoCopy() // Now that we have copied, update the Paste menu item nsCOMPtr globalObject; doc->GetScriptGlobalObject(getter_AddRefs(globalObject)); - nsCOMPtr domWindow = do_QueryInterface(globalObject); + nsCOMPtr domWindow = do_QueryInterface(globalObject); if (domWindow) { domWindow->UpdateCommands(NS_ConvertASCIItoUCS2("clipboard")); diff --git a/layout/base/src/nsDocument.cpp b/layout/base/src/nsDocument.cpp index 575d83ad51c9..a8a1f9839116 100644 --- a/layout/base/src/nsDocument.cpp +++ b/layout/base/src/nsDocument.cpp @@ -104,7 +104,7 @@ #include "nsIPrivateDOMImplementation.h" #include "nsIInterfaceRequestor.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMElement.h" #include "nsIAnonymousContentCreator.h" @@ -2409,7 +2409,7 @@ NS_IMETHODIMP nsDocument::GetLocation(jsval* aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->GetLocation(aLocation); } @@ -2421,7 +2421,7 @@ NS_IMETHODIMP nsDocument::SetLocation(jsval aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->SetLocation(aLocation); } @@ -2457,8 +2457,8 @@ nsDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); window->QueryInterface(NS_GET_IID(nsIDOMAbstractView), @@ -2497,8 +2497,8 @@ nsDocument::GetPlugins(nsIDOMPluginArray** aPlugins) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); nsCOMPtr navigator; diff --git a/layout/base/src/nsDocumentViewer.cpp b/layout/base/src/nsDocumentViewer.cpp index 2537fca190d8..e2d145a48591 100644 --- a/layout/base/src/nsDocumentViewer.cpp +++ b/layout/base/src/nsDocumentViewer.cpp @@ -27,7 +27,7 @@ #include "nsIContent.h" #include "nsIContentViewerContainer.h" #include "nsIDocumentViewer.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIImageGroup.h" #include "nsIImageObserver.h" @@ -1838,7 +1838,7 @@ NS_IMETHODIMP nsDocViwerSelectionListener::NotifySelectionChanged(nsIDOMDocument nsCOMPtr scriptGlobalObject; theDoc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); if (!domWindow) return NS_ERROR_FAILURE; domWindow->UpdateCommands(NS_ConvertToString("select")); diff --git a/layout/events/src/nsDOMEvent.cpp b/layout/events/src/nsDOMEvent.cpp index 74a6cc26ad04..4f5ef037e84e 100644 --- a/layout/events/src/nsDOMEvent.cpp +++ b/layout/events/src/nsDOMEvent.cpp @@ -36,7 +36,7 @@ #include "nsIScrollableView.h" #include "nsIDOMEventTarget.h" #include "nsIInterfaceRequestor.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMAbstractView.h" #include "prmem.h" #include "nsLayoutAtoms.h" @@ -296,8 +296,8 @@ nsDOMEvent::GetView(nsIDOMAbstractView** aView) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); window->QueryInterface(NS_GET_IID(nsIDOMAbstractView), (void **)aView); diff --git a/layout/events/src/nsEventStateManager.cpp b/layout/events/src/nsEventStateManager.cpp index 718844a0300f..076485ad8a5b 100644 --- a/layout/events/src/nsEventStateManager.cpp +++ b/layout/events/src/nsEventStateManager.cpp @@ -53,7 +53,7 @@ #include "nsIScriptGlobalObject.h" #include "nsIPrivateDOMEvent.h" #include "nsIGfxTextControlFrame.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #include "nsIEnumerator.h" #include "nsFrameTraversal.h" @@ -342,7 +342,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, nsCOMPtr ourGlobal; gLastFocusedDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetRootCommandDispatcher(gLastFocusedDocument, getter_AddRefs(commandDispatcher)); @@ -406,7 +406,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, nsCOMPtr commandDispatcher; nsCOMPtr focusedElement; - nsCOMPtr focusedWindow; + nsCOMPtr focusedWindow; nsCOMPtr xulDoc = do_QueryInterface(mDocument); if (xulDoc) { @@ -432,7 +432,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, { nsCOMPtr privateWindow = do_QueryInterface(focusedWindow); if(privateWindow){ - nsCOMPtr privateRootWindow; + nsCOMPtr privateRootWindow; privateWindow->GetPrivateRoot(getter_AddRefs(privateRootWindow)); if(privateRootWindow) { nsCOMPtr privateParentDoc; @@ -508,7 +508,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext, // focused sub-window and sub-element for this top-level // window. nsCOMPtr commandDispatcher; - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -780,14 +780,14 @@ nsEventStateManager::ChangeTextSize(PRInt32 change) { nsCOMPtr ourGlobal; gLastFocusedDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); NS_ENSURE_TRUE(ourWindow, NS_ERROR_FAILURE); ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); NS_ENSURE_TRUE(rootWindow, NS_ERROR_FAILURE); - nsCOMPtr windowContent; + nsCOMPtr windowContent; rootWindow->Get_content(getter_AddRefs(windowContent)); NS_ENSURE_TRUE(windowContent, NS_ERROR_FAILURE); diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 9a997675f2b4..0b3d14c61129 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -51,7 +51,7 @@ #include "nsIStatefulFrame.h" #include "nsISupportsPrimitives.h" #include "nsIComponentManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIFilePicker.h" #include "nsIDOMMouseEvent.h" @@ -251,7 +251,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) nsresult result; - // Get parent nsIDOMWindow object. + // Get parent nsIDOMWindowInternal object. nsCOMPtr content; result = GetContent(getter_AddRefs(content)); if (!content) @@ -267,7 +267,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) if (!scriptGlobalObject) return NS_FAILED(result) ? result : NS_ERROR_FAILURE; - nsCOMPtr parentWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr parentWindow = do_QueryInterface(scriptGlobalObject); if (!parentWindow) return NS_ERROR_FAILURE; diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 6c9b8988cae3..bbd8369d8cd0 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -107,7 +107,7 @@ #include "nsIReflowCallback.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #ifdef INCLUDE_XUL #include "nsIDOMXULDocument.h" @@ -1540,7 +1540,7 @@ static void CheckForFocus(nsIDocument* aDocument) // of the command dispatcher moves into the embedding layer. nsCOMPtr globalObject; aDocument->GetScriptGlobalObject(getter_AddRefs(globalObject)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(globalObject); ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); nsCOMPtr rootDocument; @@ -1554,7 +1554,7 @@ static void CheckForFocus(nsIDocument* aDocument) if (commandDispatcher) { // Suppress the command dispatcher. commandDispatcher->SetSuppressFocus(PR_TRUE); - nsCOMPtr focusedWindow; + nsCOMPtr focusedWindow; commandDispatcher->GetFocusedWindow(getter_AddRefs(focusedWindow)); // See if the command dispatcher is holding on to an orphan window. @@ -1571,7 +1571,7 @@ static void CheckForFocus(nsIDocument* aDocument) } } - nsCOMPtr domWindow = do_QueryInterface(ourWindow); + nsCOMPtr domWindow = do_QueryInterface(ourWindow); if (domWindow == focusedWindow) { PRBool active; commandDispatcher->GetActive(&active); @@ -1951,7 +1951,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame){ nsCOMPtr commandDispatcher; nsCOMPtr ourGlobal; document->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -2721,7 +2721,7 @@ PresShell::ScrollFrameIntoView(nsIFrame *aFrame, nsCOMPtr commandDispatcher; nsCOMPtr ourGlobal; document->GetScriptGlobalObject(getter_AddRefs(ourGlobal)); - nsCOMPtr rootWindow; + nsCOMPtr rootWindow; nsCOMPtr ourWindow = do_QueryInterface(ourGlobal); if(ourWindow) { ourWindow->GetPrivateRoot(getter_AddRefs(rootWindow)); @@ -2971,7 +2971,7 @@ PresShell::DoCopy() // Now that we have copied, update the Paste menu item nsCOMPtr globalObject; doc->GetScriptGlobalObject(getter_AddRefs(globalObject)); - nsCOMPtr domWindow = do_QueryInterface(globalObject); + nsCOMPtr domWindow = do_QueryInterface(globalObject); if (domWindow) { domWindow->UpdateCommands(NS_ConvertASCIItoUCS2("clipboard")); diff --git a/layout/html/content/src/nsHTMLImageElement.cpp b/layout/html/content/src/nsHTMLImageElement.cpp index 091d1c6ed99c..ac36c8207d9a 100644 --- a/layout/html/content/src/nsHTMLImageElement.cpp +++ b/layout/html/content/src/nsHTMLImageElement.cpp @@ -37,7 +37,7 @@ #include "nsIJSNativeInitializer.h" #include "nsSize.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" @@ -649,7 +649,7 @@ nsHTMLImageElement::GetCallerSourceURL(JSContext* cx, nsCOMPtr global; nsLayoutUtils::GetDynamicScriptGlobal(cx, getter_AddRefs(global)); if (global) { - nsCOMPtr window = do_QueryInterface(global); + nsCOMPtr window = do_QueryInterface(global); if (window) { nsCOMPtr domDoc; @@ -763,7 +763,7 @@ nsHTMLImageElement::Initialize(JSContext* aContext, nsLayoutUtils::GetStaticScriptGlobal(aContext, aObj, getter_AddRefs(globalObject));; if (globalObject) { - nsIDOMWindow* domWindow; + nsIDOMWindowInternal* domWindow; result = globalObject->QueryInterface(kIDOMWindowIID, (void**)&domWindow); if (NS_SUCCEEDED(result)) { nsIDOMDocument* domDocument; diff --git a/layout/html/content/src/nsHTMLSpacerElement.cpp b/layout/html/content/src/nsHTMLSpacerElement.cpp index e0d264e965e0..18a6b8e19340 100644 --- a/layout/html/content/src/nsHTMLSpacerElement.cpp +++ b/layout/html/content/src/nsHTMLSpacerElement.cpp @@ -35,7 +35,7 @@ #include "nsIJSScriptObject.h" #include "nsSize.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" diff --git a/layout/html/document/src/nsHTMLDocument.cpp b/layout/html/document/src/nsHTMLDocument.cpp index 5e261f8d202b..468f61c3fa45 100644 --- a/layout/html/document/src/nsHTMLDocument.cpp +++ b/layout/html/document/src/nsHTMLDocument.cpp @@ -46,7 +46,7 @@ #include "nsIDOMComment.h" #include "nsIDOMDOMImplementation.h" #include "nsIDOMDocumentType.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMHTMLFormElement.h" #include "nsIStreamListener.h" #include "nsIURL.h" @@ -2007,7 +2007,7 @@ nsHTMLDocument::GetSourceDocumentURL(JSContext* cx, nsCOMPtr global; nsLayoutUtils::GetDynamicScriptGlobal(cx, getter_AddRefs(global)); if (global) { - nsCOMPtr window(do_QueryInterface(global, &result)); + nsCOMPtr window(do_QueryInterface(global, &result)); if (window) { nsCOMPtr document; diff --git a/layout/html/forms/public/nsIFormSubmitObserver.h b/layout/html/forms/public/nsIFormSubmitObserver.h index 8b2b99f8788f..892c848b79ad 100644 --- a/layout/html/forms/public/nsIFormSubmitObserver.h +++ b/layout/html/forms/public/nsIFormSubmitObserver.h @@ -32,7 +32,7 @@ #include "nsISupports.h" #include "prtypes.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIURI.h" class nsString; @@ -55,7 +55,7 @@ public: * will be loaded in (form could have target attribute set) * @param actionURL- URL to which the form will be submitted. */ - NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindow* window, nsIURI* actionURL) = 0; + NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindowInternal* window, nsIURI* actionURL) = 0; }; diff --git a/layout/html/forms/src/nsFileControlFrame.cpp b/layout/html/forms/src/nsFileControlFrame.cpp index 9a997675f2b4..0b3d14c61129 100644 --- a/layout/html/forms/src/nsFileControlFrame.cpp +++ b/layout/html/forms/src/nsFileControlFrame.cpp @@ -51,7 +51,7 @@ #include "nsIStatefulFrame.h" #include "nsISupportsPrimitives.h" #include "nsIComponentManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIFilePicker.h" #include "nsIDOMMouseEvent.h" @@ -251,7 +251,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) nsresult result; - // Get parent nsIDOMWindow object. + // Get parent nsIDOMWindowInternal object. nsCOMPtr content; result = GetContent(getter_AddRefs(content)); if (!content) @@ -267,7 +267,7 @@ nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) if (!scriptGlobalObject) return NS_FAILED(result) ? result : NS_ERROR_FAILURE; - nsCOMPtr parentWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr parentWindow = do_QueryInterface(scriptGlobalObject); if (!parentWindow) return NS_ERROR_FAILURE; diff --git a/layout/html/forms/src/nsFormFrame.cpp b/layout/html/forms/src/nsFormFrame.cpp index 8581b1e017fe..a1266e429955 100644 --- a/layout/html/forms/src/nsFormFrame.cpp +++ b/layout/html/forms/src/nsFormFrame.cpp @@ -110,7 +110,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); // Security #include "nsIScriptSecurityManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); static NS_DEFINE_CID(kPlatformCharsetCID, NS_PLATFORMCHARSET_CID); @@ -864,7 +864,7 @@ nsFormFrame::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame) nsCOMPtr globalObject; document->GetScriptGlobalObject(getter_AddRefs(globalObject)); - nsCOMPtr window = do_QueryInterface(globalObject); + nsCOMPtr window = do_QueryInterface(globalObject); for (theEnum->First(); theEnum->IsDone() != NS_OK; theEnum->Next()) { result = theEnum->CurrentItem(getter_AddRefs(inst)); diff --git a/layout/html/forms/src/nsGfxTextControlFrame.cpp b/layout/html/forms/src/nsGfxTextControlFrame.cpp index c113d121d451..6d41444b91fd 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame.cpp +++ b/layout/html/forms/src/nsGfxTextControlFrame.cpp @@ -46,7 +46,7 @@ #include "nsIFrameManager.h" #include "nsIDOMHTMLInputElement.h" #include "nsIDOMHTMLTextAreaElement.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScrollbar.h" #include "nsIScrollableFrame.h" #include "nsIScriptGlobalObject.h" @@ -3539,7 +3539,7 @@ nsresult nsGfxTextControlFrame::UpdateTextControlCommands(const nsString& aComma if (NS_FAILED(rv)) return rv; if (!scriptGlobalObject) return NS_ERROR_FAILURE; - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject); if (!domWindow) return NS_ERROR_FAILURE; return domWindow->UpdateCommands(aCommand); diff --git a/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/layout/html/forms/src/nsGfxTextControlFrame2.cpp index 12e728833733..ab75a7d796a6 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -90,7 +90,7 @@ #include "nsIDOMRange.h" //for selection settting helper func #include "nsRange.h" //for selection settting helper func (i cant believe this is exported!?) #include "nsIScriptGlobalObject.h" //needed for notify selection changed to update the menus ect. -#include "nsIDOMWindow.h" //needed for notify selection changed to update the menus ect. +#include "nsIDOMWindowInternal.h" //needed for notify selection changed to update the menus ect. #include "nsITextContent.h" //needed to create initial text control content #include "nsITransactionManager.h" @@ -518,7 +518,7 @@ nsresult nsTextInputListener::UpdateTextInputCommands(const nsString& commandsTo if (NS_FAILED(rv) || !scriptGlobalObject ) return rv?rv:NS_ERROR_FAILURE; - nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject, &rv); + nsCOMPtr domWindow = do_QueryInterface(scriptGlobalObject, &rv); if (NS_FAILED(rv) || !domWindow ) return rv?rv:NS_ERROR_FAILURE; diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index c429b7332d0e..fae6b207f0fd 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -80,7 +80,7 @@ #include "nsIBindingManager.h" #include "nsIXBLBinding.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #ifdef INCLUDE_XUL #include "nsIDOMXULCommandDispatcher.h" diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 9ceed37a56e4..924e4e759883 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -39,7 +39,7 @@ #include "nsWidgetsCID.h" #include "nsMenuFrame.h" #include "nsIPopupSetFrame.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMScreen.h" #include "nsIScriptGlobalObject.h" #include "nsIPresShell.h" @@ -561,7 +561,7 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, // Compute info about the screen dimensions. Because of multiple monitor systems, // the left or top sides of the screen may be in negative space (main monitor is on the // right, etc). We need to be sure to do the right thing. - nsCOMPtr window(do_QueryInterface(scriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(scriptGlobalObject)); nsCOMPtr screen; window->GetScreen(getter_AddRefs(screen)); PRInt32 screenWidth = 0, screenHeight = 0; diff --git a/layout/xul/base/src/nsTitleBarFrame.cpp b/layout/xul/base/src/nsTitleBarFrame.cpp index 97bdea4f4d0d..b5c504d1a9cc 100644 --- a/layout/xul/base/src/nsTitleBarFrame.cpp +++ b/layout/xul/base/src/nsTitleBarFrame.cpp @@ -34,7 +34,7 @@ #include "nsIWidget.h" #include "nsIPresContext.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIViewManager.h" @@ -161,7 +161,7 @@ nsTitleBarFrame::HandleEvent(nsIPresContext* aPresContext, presShell->GetDocument(getter_AddRefs(document)); nsCOMPtr scriptGlobalObject; document->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); - nsCOMPtr window(do_QueryInterface(scriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(scriptGlobalObject)); diff --git a/profile/pref-migrator/src/nsPrefMigration.cpp b/profile/pref-migrator/src/nsPrefMigration.cpp index 1c0ed8034e61..fd6a5f733a12 100644 --- a/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/profile/pref-migrator/src/nsPrefMigration.cpp @@ -455,8 +455,8 @@ nsPrefMigration::ShowSpaceDialog(PRInt32 *choice) nsresult rv = mPMProgressWindow->GetDocShell(getter_AddRefs(docShell)); if (NS_FAILED(rv)) return rv; - // Now convert the DocShell to an nsIDOMWindow - nsCOMPtr PMDOMWindow(do_GetInterface(docShell)); + // Now convert the DocShell to an nsIDOMWindowInternal + nsCOMPtr PMDOMWindow(do_GetInterface(docShell)); if (!PMDOMWindow) return NS_ERROR_FAILURE; // Get the script global object for the window @@ -501,7 +501,7 @@ nsPrefMigration::ShowSpaceDialog(PRInt32 *choice) if (argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = PMDOMWindow->OpenDialog(jsContext, argv, 4, diff --git a/profile/pref-migrator/src/nsPrefMigration.h b/profile/pref-migrator/src/nsPrefMigration.h index 1de100d0b8d1..ab70435809bc 100644 --- a/profile/pref-migrator/src/nsPrefMigration.h +++ b/profile/pref-migrator/src/nsPrefMigration.h @@ -32,7 +32,7 @@ #include "nsIServiceManager.h" #include "nsICommonDialogs.h" #include "nsCOMPtr.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIFileSpec.h" #include "nsPrefMigrationCIDs.h" #include "nsIPrefMigration.h" @@ -151,7 +151,7 @@ class nsPrefMigration: public nsIPrefMigration nsCOMPtr m_prefs; nsCOMPtr m_prefsFile; - nsCOMPtr m_parentWindow; + nsCOMPtr m_parentWindow; nsCOMPtr mPMProgressWindow; }; diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index 7a24da7ddad9..21984698ef4d 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -70,7 +70,7 @@ #include "nsIScriptGlobalObject.h" #include "nsIBaseWindow.h" #include "nsICommonDialogs.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIWindowMediator.h" #if defined (XP_UNIX) @@ -1605,7 +1605,7 @@ nsProfile::ShowProfileWizard(void) { nsresult rv = NS_OK; PRBool hasParentWindow = PR_FALSE; - nsCOMPtr PMDOMWindow; + nsCOMPtr PMDOMWindow; // Get the window mediator NS_WITH_SERVICE(nsIWindowMediator, windowMediator, kWindowMediatorCID, &rv); @@ -1680,7 +1680,7 @@ nsProfile::ShowProfileWizard(void) if (argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = PMDOMWindow->OpenDialog(jsContext, argv, 4, diff --git a/rdf/chrome/src/nsChromeRegistry.cpp b/rdf/chrome/src/nsChromeRegistry.cpp index 300188cef837..fd9edd44674c 100644 --- a/rdf/chrome/src/nsChromeRegistry.cpp +++ b/rdf/chrome/src/nsChromeRegistry.cpp @@ -51,7 +51,7 @@ #include "nsIFileLocator.h" #include "nsIXBLService.h" #include "nsPIDOMWindow.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowCollection.h" #include "nsIDOMLocation.h" #include "nsIWindowMediator.h" @@ -1069,7 +1069,7 @@ NS_IMETHODIMP nsChromeRegistry::RefreshSkins() nsCOMPtr protoWindow; rv = windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (NS_SUCCEEDED(rv) && protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) { rv = RefreshWindow(domWindow); if (NS_FAILED(rv)) return rv; @@ -1103,7 +1103,7 @@ static PRBool IsChromeURI(nsIURI* aURI) return PR_FALSE; } -NS_IMETHODIMP nsChromeRegistry::RefreshWindow(nsIDOMWindow* aWindow) +NS_IMETHODIMP nsChromeRegistry::RefreshWindow(nsIDOMWindowInternal* aWindow) { nsresult rv; // Get the DOM document. diff --git a/rdf/chrome/src/nsChromeRegistry.h b/rdf/chrome/src/nsChromeRegistry.h index 6322bdc5738d..d05d6bdf6621 100644 --- a/rdf/chrome/src/nsChromeRegistry.h +++ b/rdf/chrome/src/nsChromeRegistry.h @@ -32,7 +32,7 @@ class nsISimpleEnumerator; class nsSupportsHashtable; class nsIRDFContainer; class nsIRDFContainerUtils; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDocument; #include "nsIRDFCompositeDataSource.h" @@ -83,7 +83,7 @@ private: NS_IMETHOD GetProfileRoot(nsCString& aFileURL); NS_IMETHOD GetInstallRoot(nsCString& aFileURL); - NS_IMETHOD RefreshWindow(nsIDOMWindow* aWindow); + NS_IMETHOD RefreshWindow(nsIDOMWindowInternal* aWindow); NS_IMETHOD GetArcs(nsIRDFDataSource* aDataSource, const nsCString& aType, diff --git a/rdf/chrome/src/nsChromeUIDataSource.h b/rdf/chrome/src/nsChromeUIDataSource.h index 90832af3f6f6..cbb5172377bb 100644 --- a/rdf/chrome/src/nsChromeUIDataSource.h +++ b/rdf/chrome/src/nsChromeUIDataSource.h @@ -29,7 +29,7 @@ class nsICSSLoader; class nsISimpleEnumerator; class nsSupportsHashtable; class nsIRDFContainer; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDocument; #include "nsIRDFDataSource.h" diff --git a/rdf/content/public/nsIDOMXULCommandDispatcher.h b/rdf/content/public/nsIDOMXULCommandDispatcher.h index b5bc0a7a1d54..3153278e4a23 100644 --- a/rdf/content/public/nsIDOMXULCommandDispatcher.h +++ b/rdf/content/public/nsIDOMXULCommandDispatcher.h @@ -30,7 +30,7 @@ class nsIController; class nsIDOMElement; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIControllers; #define NS_IDOMXULCOMMANDDISPATCHER_IID \ @@ -44,8 +44,8 @@ public: NS_IMETHOD GetFocusedElement(nsIDOMElement** aFocusedElement)=0; NS_IMETHOD SetFocusedElement(nsIDOMElement* aFocusedElement)=0; - NS_IMETHOD GetFocusedWindow(nsIDOMWindow** aFocusedWindow)=0; - NS_IMETHOD SetFocusedWindow(nsIDOMWindow* aFocusedWindow)=0; + NS_IMETHOD GetFocusedWindow(nsIDOMWindowInternal** aFocusedWindow)=0; + NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aFocusedWindow)=0; NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFocus)=0; NS_IMETHOD SetSuppressFocus(PRBool aSuppressFocus)=0; @@ -71,8 +71,8 @@ public: #define NS_DECL_IDOMXULCOMMANDDISPATCHER \ NS_IMETHOD GetFocusedElement(nsIDOMElement** aFocusedElement); \ NS_IMETHOD SetFocusedElement(nsIDOMElement* aFocusedElement); \ - NS_IMETHOD GetFocusedWindow(nsIDOMWindow** aFocusedWindow); \ - NS_IMETHOD SetFocusedWindow(nsIDOMWindow* aFocusedWindow); \ + NS_IMETHOD GetFocusedWindow(nsIDOMWindowInternal** aFocusedWindow); \ + NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aFocusedWindow); \ NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFocus); \ NS_IMETHOD SetSuppressFocus(PRBool aSuppressFocus); \ NS_IMETHOD GetSuppressFocusScroll(PRBool* aSuppressFocusScroll); \ @@ -90,8 +90,8 @@ public: #define NS_FORWARD_IDOMXULCOMMANDDISPATCHER(_to) \ NS_IMETHOD GetFocusedElement(nsIDOMElement** aFocusedElement) { return _to GetFocusedElement(aFocusedElement); } \ NS_IMETHOD SetFocusedElement(nsIDOMElement* aFocusedElement) { return _to SetFocusedElement(aFocusedElement); } \ - NS_IMETHOD GetFocusedWindow(nsIDOMWindow** aFocusedWindow) { return _to GetFocusedWindow(aFocusedWindow); } \ - NS_IMETHOD SetFocusedWindow(nsIDOMWindow* aFocusedWindow) { return _to SetFocusedWindow(aFocusedWindow); } \ + NS_IMETHOD GetFocusedWindow(nsIDOMWindowInternal** aFocusedWindow) { return _to GetFocusedWindow(aFocusedWindow); } \ + NS_IMETHOD SetFocusedWindow(nsIDOMWindowInternal* aFocusedWindow) { return _to SetFocusedWindow(aFocusedWindow); } \ NS_IMETHOD GetSuppressFocus(PRBool* aSuppressFocus) { return _to GetSuppressFocus(aSuppressFocus); } \ NS_IMETHOD SetSuppressFocus(PRBool aSuppressFocus) { return _to SetSuppressFocus(aSuppressFocus); } \ NS_IMETHOD GetSuppressFocusScroll(PRBool* aSuppressFocusScroll) { return _to GetSuppressFocusScroll(aSuppressFocusScroll); } \ diff --git a/rdf/content/src/nsDlgDefaultKeys.cpp b/rdf/content/src/nsDlgDefaultKeys.cpp index 860d3212d6cc..75f19e098a67 100644 --- a/rdf/content/src/nsDlgDefaultKeys.cpp +++ b/rdf/content/src/nsDlgDefaultKeys.cpp @@ -29,7 +29,7 @@ #include "nsIDOMKeyListener.h" #include "nsIDOMMouseListener.h" #include "nsIDOMUIEvent.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULDocument.h" #include "nsINSEvent.h" #include "nsIPresContext.h" diff --git a/rdf/content/src/nsJSXULCommandDispatcher.cpp b/rdf/content/src/nsJSXULCommandDispatcher.cpp index ee8f4ce812f2..e1d78b4d7df0 100644 --- a/rdf/content/src/nsJSXULCommandDispatcher.cpp +++ b/rdf/content/src/nsJSXULCommandDispatcher.cpp @@ -37,7 +37,7 @@ #include "nsIController.h" #include "nsIDOMElement.h" #include "nsIDOMXULCommandDispatcher.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIControllers.h" @@ -98,7 +98,7 @@ GetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_FOCUSEDWINDOW, PR_FALSE); if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; + nsIDOMWindowInternal* prop; rv = a->GetFocusedWindow(&prop); if (NS_SUCCEEDED(rv)) { // get the js object @@ -197,7 +197,7 @@ SetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v { rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_FOCUSEDWINDOW, PR_TRUE); if (NS_SUCCEEDED(rv)) { - nsIDOMWindow* prop; + nsIDOMWindowInternal* prop; if (PR_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)&prop, kIWindowIID, NS_ConvertASCIItoUCS2("Window"), cx, *vp)) { diff --git a/rdf/content/src/nsXULCommandDispatcher.cpp b/rdf/content/src/nsXULCommandDispatcher.cpp index af6d011185f8..19d4f7766a51 100644 --- a/rdf/content/src/nsXULCommandDispatcher.cpp +++ b/rdf/content/src/nsXULCommandDispatcher.cpp @@ -37,7 +37,7 @@ #include "nsIDOMNSHTMLInputElement.h" #include "nsIDOMNSHTMLTextAreaElement.h" #include "nsIDOMUIEvent.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULElement.h" #include "nsIDocument.h" #include "nsIPresContext.h" @@ -134,7 +134,7 @@ nsXULCommandDispatcher::GetFocusedElement(nsIDOMElement** aElement) } NS_IMETHODIMP -nsXULCommandDispatcher::GetFocusedWindow(nsIDOMWindow** aWindow) +nsXULCommandDispatcher::GetFocusedWindow(nsIDOMWindowInternal** aWindow) { *aWindow = mCurrentWindow; NS_IF_ADDREF(*aWindow); @@ -153,7 +153,7 @@ nsXULCommandDispatcher::SetFocusedElement(nsIDOMElement* aElement) } NS_IMETHODIMP -nsXULCommandDispatcher::SetFocusedWindow(nsIDOMWindow* aWindow) +nsXULCommandDispatcher::SetFocusedWindow(nsIDOMWindowInternal* aWindow) { mCurrentWindow = aWindow; return NS_OK; @@ -350,7 +350,7 @@ nsXULCommandDispatcher::GetControllers(nsIControllers** aResult) return htmlInputElement->GetControllers(aResult); } else if (mCurrentWindow) { - nsCOMPtr domWindow = do_QueryInterface(mCurrentWindow); + nsCOMPtr domWindow = do_QueryInterface(mCurrentWindow); if (domWindow) return domWindow->GetControllers(aResult); } @@ -398,7 +398,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) // but we don't hear the subsequent focus to the Ender window. nsCOMPtr ownerDoc; domElement->GetOwnerDocument(getter_AddRefs(ownerDoc)); - nsCOMPtr domWindow; + nsCOMPtr domWindow; GetParentWindowFromDocument(ownerDoc, getter_AddRefs(domWindow)); if (domWindow) SetFocusedWindow(domWindow); @@ -406,7 +406,7 @@ nsXULCommandDispatcher::Focus(nsIDOMEvent* aEvent) else { // We're focusing a window. We only want to do an update commands // if no element is focused. - nsCOMPtr domWindow; + nsCOMPtr domWindow; nsCOMPtr domDoc = do_QueryInterface(t); if (domDoc) { GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); @@ -463,7 +463,7 @@ nsXULCommandDispatcher::Blur(nsIDOMEvent* aEvent) SetFocusedElement(nsnull); } - nsCOMPtr domWindow; + nsCOMPtr domWindow; nsCOMPtr domDoc = do_QueryInterface(t); if (domDoc) { GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); @@ -530,7 +530,7 @@ nsXULCommandDispatcher::Matches(const nsString& aList, nsresult -nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, nsIDOMWindow** aWindow) +nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, nsIDOMWindowInternal** aWindow) { nsCOMPtr objectOwner = do_QueryInterface(aDocument); if(!objectOwner) return NS_OK; @@ -539,7 +539,7 @@ nsXULCommandDispatcher::GetParentWindowFromDocument(nsIDOMDocument* aDocument, n objectOwner->GetScriptGlobalObject(getter_AddRefs(globalObject)); if(!globalObject) return NS_OK; - nsCOMPtr domWindow = do_QueryInterface(globalObject); + nsCOMPtr domWindow = do_QueryInterface(globalObject); *aWindow = domWindow; NS_IF_ADDREF(*aWindow); return NS_OK; @@ -568,7 +568,7 @@ nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aComman // Move up to the window. nsCOMPtr domDoc; mCurrentElement->GetOwnerDocument(getter_AddRefs(domDoc)); - nsCOMPtr domWindow; + nsCOMPtr domWindow; GetParentWindowFromDocument(domDoc, getter_AddRefs(domWindow)); currentWindow = do_QueryInterface(domWindow); } @@ -579,7 +579,7 @@ nsXULCommandDispatcher::GetControllerForCommand(const nsAReadableString& aComman else return NS_OK; while(currentWindow) { - nsCOMPtr domWindow = do_QueryInterface(currentWindow); + nsCOMPtr domWindow = do_QueryInterface(currentWindow); if(domWindow) { nsCOMPtr controllers2; domWindow->GetControllers(getter_AddRefs(controllers2)); diff --git a/rdf/content/src/nsXULCommandDispatcher.h b/rdf/content/src/nsXULCommandDispatcher.h index 3758d3d1cfab..a07422cfef50 100644 --- a/rdf/content/src/nsXULCommandDispatcher.h +++ b/rdf/content/src/nsXULCommandDispatcher.h @@ -76,7 +76,7 @@ public: NS_IMETHOD SetScriptObject(void *aScriptObject); public: - static nsresult GetParentWindowFromDocument(nsIDOMDocument* aElement, nsIDOMWindow** aWindow); + static nsresult GetParentWindowFromDocument(nsIDOMDocument* aElement, nsIDOMWindowInternal** aWindow); protected: void* mScriptObject; // ???? @@ -85,7 +85,7 @@ protected: // waiting to happen! If somebody deletes the node, then asks us // for the focus, we'll get killed! nsCOMPtr mCurrentElement; // [OWNER] - nsCOMPtr mCurrentWindow; // [OWNER] + nsCOMPtr mCurrentWindow; // [OWNER] PRBool mSuppressFocus; PRBool mSuppressFocusScroll; diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index d1db848dff33..cc77f87b5f71 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -115,7 +115,7 @@ #include "nsRDFCID.h" #include "nsRDFDOMNodeList.h" #include "nsXPIDLString.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsXULCommandDispatcher.h" #include "nsXULDocument.h" #include "nsXULElement.h" @@ -2798,8 +2798,8 @@ nsXULDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView) nsCOMPtr ifrq(do_QueryInterface(container)); NS_ENSURE_TRUE(ifrq, NS_OK); - nsCOMPtr window; - ifrq->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(window)); + nsCOMPtr window; + ifrq->GetInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(window)); NS_ENSURE_TRUE(window, NS_OK); window->QueryInterface(NS_GET_IID(nsIDOMAbstractView), @@ -2999,7 +2999,7 @@ NS_IMETHODIMP nsXULDocument::GetLocation(jsval* aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->GetLocation(aLocation); } @@ -3011,7 +3011,7 @@ NS_IMETHODIMP nsXULDocument::SetLocation(jsval aLocation) { if (mScriptGlobalObject) { - nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); + nsCOMPtr window(do_QueryInterface(mScriptGlobalObject)); if(window) { return window->SetLocation(aLocation); } diff --git a/rdf/content/src/nsXULKeyListener.cpp b/rdf/content/src/nsXULKeyListener.cpp index 27e327521740..b8d410761a95 100644 --- a/rdf/content/src/nsXULKeyListener.cpp +++ b/rdf/content/src/nsXULKeyListener.cpp @@ -33,7 +33,7 @@ #include "nsIDOMMouseListener.h" #include "nsIDOMKeyEvent.h" #include "nsIDOMNSUIEvent.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #include "nsIDOMXULDocument.h" #include "nsINSEvent.h" @@ -623,7 +623,7 @@ nsresult nsXULKeyListenerImpl::DoKey(nsIDOMEvent* aKeyEvent, eEventType aEventTy nsCOMPtr commandDispatcher; mDOMDocument->GetCommandDispatcher(getter_AddRefs(commandDispatcher)); - nsCOMPtr domWindow; + nsCOMPtr domWindow; commandDispatcher->GetFocusedWindow(getter_AddRefs(domWindow)); piWindow = do_QueryInterface(domWindow); @@ -640,7 +640,7 @@ nsresult nsXULKeyListenerImpl::DoKey(nsIDOMEvent* aKeyEvent, eEventType aEventTy if (!handled) { while (piWindow && !handled) { // See if we have a XUL document. Give it a crack. - nsCOMPtr domWindow = do_QueryInterface(piWindow); + nsCOMPtr domWindow = do_QueryInterface(piWindow); nsCOMPtr windowDoc; domWindow->GetDocument(getter_AddRefs(windowDoc)); nsCOMPtr xulWindowDoc = do_QueryInterface(windowDoc); diff --git a/rdf/content/src/nsXULPopupListener.cpp b/rdf/content/src/nsXULPopupListener.cpp index d62192a81017..77527697a19b 100644 --- a/rdf/content/src/nsXULPopupListener.cpp +++ b/rdf/content/src/nsXULPopupListener.cpp @@ -42,7 +42,7 @@ #include "nsRDFCID.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULDocument.h" #include "nsIDocument.h" #include "nsIContent.h" @@ -645,7 +645,7 @@ XULPopupListenerImpl::LaunchPopup(PRInt32 aClientX, PRInt32 aClientY) if (global) { if (NS_OK == global->GetContext(getter_AddRefs(context))) { // Get the DOM window - nsCOMPtr domWindow = do_QueryInterface(global); + nsCOMPtr domWindow = do_QueryInterface(global); if (domWindow != nsnull) { // Find out if we're anchored. nsAutoString anchorAlignment; anchorAlignment.AssignWithConversion("none"); diff --git a/rdf/content/src/nsXULPrototypeDocument.cpp b/rdf/content/src/nsXULPrototypeDocument.cpp index 0786f25a7f0d..f9c357c8e6a1 100644 --- a/rdf/content/src/nsXULPrototypeDocument.cpp +++ b/rdf/content/src/nsXULPrototypeDocument.cpp @@ -67,7 +67,7 @@ public: NS_IMETHOD SetNewDocument(nsIDOMDocument *aDocument); NS_IMETHOD SetDocShell(nsIDocShell *aDocShell); NS_IMETHOD GetDocShell(nsIDocShell **aDocShell); - NS_IMETHOD SetOpenerWindow(nsIDOMWindow *aOpener); + NS_IMETHOD SetOpenerWindow(nsIDOMWindowInternal *aOpener); NS_IMETHOD SetGlobalObjectOwner(nsIScriptGlobalObjectOwner* aOwner); NS_IMETHOD GetGlobalObjectOwner(nsIScriptGlobalObjectOwner** aOwner); NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, @@ -526,7 +526,7 @@ nsXULPDGlobalObject::GetDocShell(nsIDocShell **aDocShell) NS_IMETHODIMP -nsXULPDGlobalObject::SetOpenerWindow(nsIDOMWindow *aOpener) +nsXULPDGlobalObject::SetOpenerWindow(nsIDOMWindowInternal *aOpener) { NS_NOTREACHED("waaah!"); return NS_ERROR_UNEXPECTED; diff --git a/rdf/tests/domds/nsIDOMDataSource.idl b/rdf/tests/domds/nsIDOMDataSource.idl index 78392a6b6e53..2dfcfbfafc69 100644 --- a/rdf/tests/domds/nsIDOMDataSource.idl +++ b/rdf/tests/domds/nsIDOMDataSource.idl @@ -22,7 +22,7 @@ #include "domstubs.idl" %{C++ -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMNode.h" %} @@ -31,7 +31,7 @@ interface nsIDOMDataSource : nsISupports { void setMode(in string mode, in boolean active); boolean getMode(in string mode); - void setWindow(in nsIDOMWindow window); + void setWindow(in nsIDOMWindowInternal window); }; diff --git a/rdf/tests/domds/nsRDFDOMDataSource.cpp b/rdf/tests/domds/nsRDFDOMDataSource.cpp index 9775168c3cc7..c345d61d0672 100644 --- a/rdf/tests/domds/nsRDFDOMDataSource.cpp +++ b/rdf/tests/domds/nsRDFDOMDataSource.cpp @@ -1215,7 +1215,7 @@ nsRDFDOMDataSource::unassertEnumFunc(void *aElement, void *aData) // nsIDOMDataSource methods nsresult -nsRDFDOMDataSource::SetWindow(nsIDOMWindow *window) { +nsRDFDOMDataSource::SetWindow(nsIDOMWindowInternal *window) { nsresult rv; objectTable.Reset(); diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index f0d9c40ec3a6..6422c8c0356a 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -47,7 +47,7 @@ #include "nsXPIDLString.h" #include "nsString.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIUnkContentTypeHandler.h" #include "nsDOMError.h" @@ -96,7 +96,7 @@ protected: // and it will return TRUE. PRBool ProcessCanceledCase(nsIChannel * aChannel); - nsresult InvokeUnknownContentHandler(nsIChannel * aChannel, const char * aContentType, nsIDOMWindow * aDomWindow); + nsresult InvokeUnknownContentHandler(nsIChannel * aChannel, const char * aContentType, nsIDOMWindowInternal * aDomWindow); protected: nsCOMPtr m_contentListener; @@ -381,7 +381,7 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIChannel * aChannel, nsISupports if (NS_FAILED(rv)) { - nsCOMPtr domWindow (do_GetInterface(originalWindowContext)); + nsCOMPtr domWindow (do_GetInterface(originalWindowContext)); return InvokeUnknownContentHandler(aChannel, contentType, domWindow); } @@ -395,7 +395,7 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIChannel * aChannel, nsISupports return rv; } -nsresult nsDocumentOpenInfo::InvokeUnknownContentHandler(nsIChannel * aChannel, const char * aContentType, nsIDOMWindow * aDomWindow) +nsresult nsDocumentOpenInfo::InvokeUnknownContentHandler(nsIChannel * aChannel, const char * aContentType, nsIDOMWindowInternal * aDomWindow) { NS_ENSURE_ARG(aChannel); NS_ENSURE_ARG(aDomWindow); diff --git a/webshell/embed/xlib/qt/QMozillaContainer.cpp b/webshell/embed/xlib/qt/QMozillaContainer.cpp index f463a2df6c70..ada5a7be01af 100644 --- a/webshell/embed/xlib/qt/QMozillaContainer.cpp +++ b/webshell/embed/xlib/qt/QMozillaContainer.cpp @@ -466,8 +466,8 @@ NS_METHOD QMozillaContainer::CreatePopup( nsIDOMElement* aElement, const nsString& aPopupType, const nsString& anAnchorAlignment, const nsString& aPopupAlignment, - nsIDOMWindow* aWindow, - nsIDOMWindow** outPopup) + nsIDOMWindowInternal* aWindow, + nsIDOMWindowInternal** outPopup) { return NS_OK; } diff --git a/webshell/embed/xlib/qt/QMozillaContainer.h b/webshell/embed/xlib/qt/QMozillaContainer.h index 4481e03e80b0..9da56b5ff8b9 100644 --- a/webshell/embed/xlib/qt/QMozillaContainer.h +++ b/webshell/embed/xlib/qt/QMozillaContainer.h @@ -77,7 +77,7 @@ public: PRInt32 aXPos, PRInt32 aYPos, const nsString& aPopupType, const nsString& anAnchorAlignment, const nsString& aPopupAlignment, - nsIDOMWindow* aWindow, nsIDOMWindow** outPopup); + nsIDOMWindowInternal* aWindow, nsIDOMWindowInternal** outPopup); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken); diff --git a/webshell/public/nsIWebShell.h b/webshell/public/nsIWebShell.h index 2fa7466116cc..f532f1fc8a6e 100644 --- a/webshell/public/nsIWebShell.h +++ b/webshell/public/nsIWebShell.h @@ -30,7 +30,7 @@ #include "nsIScrollableView.h" class nsIDOMElement; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIFactory; //class nsIPostData; class nsIStreamObserver; diff --git a/widget/public/nsIFilePicker.idl b/widget/public/nsIFilePicker.idl index 333395b180a9..315e87ac9947 100644 --- a/widget/public/nsIFilePicker.idl +++ b/widget/public/nsIFilePicker.idl @@ -25,7 +25,7 @@ #include "nsIURL.idl" #include "nsILocalFile.idl" -interface nsIDOMWindow; +interface nsIDOMWindowInternal; [scriptable, uuid(c47de916-1dd1-11b2-8141-82507fa02b21)] interface nsIFilePicker : nsISupports @@ -48,12 +48,12 @@ interface nsIFilePicker : nsISupports /** * Initialize the file widget. * - * @param parent nsIDOMWindow parent. This dialog should be dependant on this parent. + * @param parent nsIDOMWindowInternal parent. This dialog should be dependant on this parent. * @param title The title for the file widget * @param mode load, save, or get folder * */ - void init(in nsIDOMWindow parent, in wstring title, in short mode); + void init(in nsIDOMWindowInternal parent, in wstring title, in short mode); /** * Append to the filter list with things from the predefined list diff --git a/widget/public/nsIFileSpecWithUI.idl b/widget/public/nsIFileSpecWithUI.idl index 1a62032604bb..fe333dc37fd8 100644 --- a/widget/public/nsIFileSpecWithUI.idl +++ b/widget/public/nsIFileSpecWithUI.idl @@ -27,7 +27,7 @@ #include "nsIFileSpec.idl" #include "nsIComponentManager.idl" -interface nsIDOMWindow; +interface nsIDOMWindowInternal; [scriptable, uuid(8ddf7681-139a-11d3-915f-dc1f8c138b7c)] interface nsIFileSpecWithUI : nsIFileSpec @@ -71,7 +71,7 @@ interface nsIFileSpecWithUI : nsIFileSpec string chooseDirectory(in string title); - attribute nsIDOMWindow parentWindow; + attribute nsIDOMWindowInternal parentWindow; }; %{C++ diff --git a/widget/src/gtk/nsFilePicker.cpp b/widget/src/gtk/nsFilePicker.cpp index 34cd37e8d1f8..1eb3dcb08ce3 100644 --- a/widget/src/gtk/nsFilePicker.cpp +++ b/widget/src/gtk/nsFilePicker.cpp @@ -256,7 +256,7 @@ NS_IMETHODIMP nsFilePicker::GetDisplayDirectory(nsILocalFile **aDirectory) return NS_OK; } -NS_IMETHODIMP nsFilePicker::Create(nsIDOMWindow *aParent, +NS_IMETHODIMP nsFilePicker::Create(nsIDOMWindowInternal *aParent, const PRUnichar *aTitle, PRInt16 aMode) { diff --git a/widget/src/gtk/nsGtkMozRemoteHelper.cpp b/widget/src/gtk/nsGtkMozRemoteHelper.cpp index d87f74b800ed..ad8b7f4f959f 100644 --- a/widget/src/gtk/nsGtkMozRemoteHelper.cpp +++ b/widget/src/gtk/nsGtkMozRemoteHelper.cpp @@ -505,7 +505,7 @@ NS_METHOD nsGtkMozRemoteHelper::OpenURLDialog (void) { nsresult rv; - nsCOMPtr lastWindow; + nsCOMPtr lastWindow; nsString name; nsString url; @@ -547,7 +547,7 @@ nsGtkMozRemoteHelper::OpenURL (const char *aURL, PRBool aNewWindow) if (aNewWindow) { - nsCOMPtr parentWindow; + nsCOMPtr parentWindow; rv = GetHiddenWindow(getter_AddRefs(parentWindow)); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; @@ -560,8 +560,8 @@ nsGtkMozRemoteHelper::OpenURL (const char *aURL, PRBool aNewWindow) } else { - nsCOMPtr lastUsedWindow; - nsCOMPtr innerWindow; + nsCOMPtr lastUsedWindow; + nsCOMPtr innerWindow; nsCOMPtr globalObject; nsCOMPtr docShell; nsCOMPtr uri; @@ -713,7 +713,7 @@ nsGtkMozRemoteHelper::AddBookmark (const char *aURL, const char *aTitle) } NS_METHOD -nsGtkMozRemoteHelper::GetHiddenWindow (nsIDOMWindow **_retval) +nsGtkMozRemoteHelper::GetHiddenWindow (nsIDOMWindowInternal **_retval) { nsresult rv; NS_WITH_PROXIED_SERVICE(nsIAppShellService, appShell, @@ -731,20 +731,20 @@ nsGtkMozRemoteHelper::GetHiddenWindow (nsIDOMWindow **_retval) if(NS_FAILED(rv)) return NS_ERROR_FAILURE; - nsCOMPtr domWindow(do_GetInterface(docShell)); + nsCOMPtr domWindow(do_GetInterface(docShell)); *_retval = domWindow; NS_IF_ADDREF(*_retval); return NS_OK; } -NS_METHOD nsGtkMozRemoteHelper::GetLastBrowserWindow (nsIDOMWindow **_retval) +NS_METHOD nsGtkMozRemoteHelper::GetLastBrowserWindow (nsIDOMWindowInternal **_retval) { NS_ENSURE_ARG_POINTER(_retval); nsresult rv; nsString browserString; - nsCOMPtr outerWindow; + nsCOMPtr outerWindow; browserString.AssignWithConversion("navigator:browser"); // get the window mediator service @@ -761,7 +761,7 @@ NS_METHOD nsGtkMozRemoteHelper::GetLastBrowserWindow (nsIDOMWindow **_retval) return NS_OK; } -NS_METHOD nsGtkMozRemoteHelper::OpenXULWindow (const char *aChromeURL, nsIDOMWindow *aParent, +NS_METHOD nsGtkMozRemoteHelper::OpenXULWindow (const char *aChromeURL, nsIDOMWindowInternal *aParent, const char *aWindowFeatures, const PRUnichar *aName, const PRUnichar *aURL) { @@ -769,7 +769,7 @@ NS_METHOD nsGtkMozRemoteHelper::OpenXULWindow (const char *aChromeURL, nsIDOMWin NS_ENSURE_ARG_POINTER(aWindowFeatures); NS_ENSURE_ARG_POINTER(aParent); - nsCOMPtr returnedWindow; + nsCOMPtr returnedWindow; nsCOMPtr scriptGlobalObj = do_QueryInterface(aParent); JSContext *jsContext = nsnull; diff --git a/widget/src/gtk/nsGtkMozRemoteHelper.h b/widget/src/gtk/nsGtkMozRemoteHelper.h index e9403cb5cb43..1ca678dda678 100644 --- a/widget/src/gtk/nsGtkMozRemoteHelper.h +++ b/widget/src/gtk/nsGtkMozRemoteHelper.h @@ -23,7 +23,7 @@ #include #include #include "nsString.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #ifndef __nsGtkMozRemoteHelper_h__ #define __nsGtkMozRemoteHelper_h__ @@ -57,9 +57,9 @@ public: static NS_METHOD AddBookmark (const char *aURL, const char *aTitle); // utility functions for getting windows - static NS_METHOD GetHiddenWindow (nsIDOMWindow **_retval); - static NS_METHOD GetLastBrowserWindow (nsIDOMWindow **_retval); - static NS_METHOD OpenXULWindow (const char *aChromeURL, nsIDOMWindow *aParent, + static NS_METHOD GetHiddenWindow (nsIDOMWindowInternal **_retval); + static NS_METHOD GetLastBrowserWindow (nsIDOMWindowInternal **_retval); + static NS_METHOD OpenXULWindow (const char *aChromeURL, nsIDOMWindowInternal *aParent, const char *aWindowFeatures, const PRUnichar *aName, const PRUnichar *aURL); diff --git a/widget/src/os2/nsFilePicker.cpp b/widget/src/os2/nsFilePicker.cpp index e7fd4dcae4b4..44a37a502947 100644 --- a/widget/src/os2/nsFilePicker.cpp +++ b/widget/src/os2/nsFilePicker.cpp @@ -397,7 +397,7 @@ NS_IMETHODIMP nsFilePicker::GetDisplayDirectory(nsILocalFile **aDirectory) return NS_OK; } -NS_IMETHODIMP nsFilePicker::Init(nsIDOMWindow *aParent, +NS_IMETHODIMP nsFilePicker::Init(nsIDOMWindowInternal *aParent, const PRUnichar *aTitle, PRInt16 aMode) { diff --git a/widget/src/xpwidgets/nsBaseFilePicker.cpp b/widget/src/xpwidgets/nsBaseFilePicker.cpp index a2d16fbcdc09..42e9f13b152f 100644 --- a/widget/src/xpwidgets/nsBaseFilePicker.cpp +++ b/widget/src/xpwidgets/nsBaseFilePicker.cpp @@ -23,7 +23,7 @@ */ #include "nsCOMPtr.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIDocShell.h" #include "nsIContentViewer.h" @@ -54,7 +54,7 @@ nsBaseFilePicker::~nsBaseFilePicker() } /* XXX aaaarrrrrrgh! */ -NS_IMETHODIMP nsBaseFilePicker::DOMWindowToWidget(nsIDOMWindow *dw, nsIWidget **aResult) +NS_IMETHODIMP nsBaseFilePicker::DOMWindowToWidget(nsIDOMWindowInternal *dw, nsIWidget **aResult) { nsresult rv = NS_ERROR_FAILURE; *aResult = nsnull; @@ -96,7 +96,7 @@ NS_IMETHODIMP nsBaseFilePicker::DOMWindowToWidget(nsIDOMWindow *dw, nsIWidget ** } //------------------------------------------------------------------------- -NS_IMETHODIMP nsBaseFilePicker::Init(nsIDOMWindow *aParent, +NS_IMETHODIMP nsBaseFilePicker::Init(nsIDOMWindowInternal *aParent, const PRUnichar *aTitle, PRInt16 aMode) { diff --git a/widget/src/xpwidgets/nsBaseFilePicker.h b/widget/src/xpwidgets/nsBaseFilePicker.h index 4765afa0953d..fd4fe77f2e1a 100644 --- a/widget/src/xpwidgets/nsBaseFilePicker.h +++ b/widget/src/xpwidgets/nsBaseFilePicker.h @@ -34,7 +34,7 @@ public: nsBaseFilePicker(); virtual ~nsBaseFilePicker(); - NS_IMETHOD Init(nsIDOMWindow *aParent, + NS_IMETHOD Init(nsIDOMWindowInternal *aParent, const PRUnichar *aTitle, PRInt16 aMode); @@ -46,7 +46,7 @@ protected: private: - NS_IMETHOD DOMWindowToWidget(nsIDOMWindow *dw, nsIWidget **aResult); + NS_IMETHOD DOMWindowToWidget(nsIDOMWindowInternal *dw, nsIWidget **aResult); }; #endif // nsBaseFilePicker_h__ diff --git a/widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp b/widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp index 0164e8c3420c..a0bb059a3c7c 100644 --- a/widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp +++ b/widget/src/xpwidgets/nsFileSpecWithUIImpl.cpp @@ -25,7 +25,7 @@ #include "nsWidgetsCID.h" #include "nsIComponentManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIWebShell.h" #include "nsIDocShell.h" @@ -47,7 +47,7 @@ static NS_DEFINE_CID(kCFileWidgetCID, NS_FILEWIDGET_CID); // // This was cribbed from nsBaseFilePicker.cpp. I will // echo the comment that appears there: aaaarrrrrrgh! -static nsIWidget *parentWidget( nsIDOMWindow *window ) { +static nsIWidget *parentWidget( nsIDOMWindowInternal *window ) { nsIWidget *result = 0; if ( window ) { nsCOMPtr sgo = do_QueryInterface( window ); @@ -291,7 +291,7 @@ NS_IMETHODIMP nsFileSpecWithUIImpl::ChooseDirectory(const char *title, char **_r } // nsFileSpecWithUIImpl::chooseDirectory NS_IMETHODIMP -nsFileSpecWithUIImpl::GetParentWindow( nsIDOMWindow **aResult ) { +nsFileSpecWithUIImpl::GetParentWindow( nsIDOMWindowInternal **aResult ) { nsresult rv = NS_OK; if ( aResult ) { @@ -305,7 +305,7 @@ nsFileSpecWithUIImpl::GetParentWindow( nsIDOMWindow **aResult ) { } NS_IMETHODIMP -nsFileSpecWithUIImpl::SetParentWindow( nsIDOMWindow *aParentWindow ) { +nsFileSpecWithUIImpl::SetParentWindow( nsIDOMWindowInternal *aParentWindow ) { nsresult rv = NS_OK; // Release current parent. diff --git a/widget/src/xpwidgets/nsFileSpecWithUIImpl.h b/widget/src/xpwidgets/nsFileSpecWithUIImpl.h index ff68fab9d601..953e6b72a6bc 100644 --- a/widget/src/xpwidgets/nsFileSpecWithUIImpl.h +++ b/widget/src/xpwidgets/nsFileSpecWithUIImpl.h @@ -270,7 +270,7 @@ protected: nsCOMPtr mBaseFileSpec; - nsIDOMWindow *mParentWindow; + nsIDOMWindowInternal *mParentWindow; }; // class nsFileSpecWithUIImpl diff --git a/xpcom/tests/SizeTest06.cpp b/xpcom/tests/SizeTest06.cpp index 284ca3bb0a47..e965c236ef30 100644 --- a/xpcom/tests/SizeTest06.cpp +++ b/xpcom/tests/SizeTest06.cpp @@ -1,6 +1,6 @@ // Test06.cpp -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIWebShell.h" #include "nsIWebShellWindow.h" @@ -42,7 +42,7 @@ NS_DEF_PTR(nsIWebShellWindow); void // nsresult -Test06_raw( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) +Test06_raw( nsIDOMWindowInternal* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) // m388, w214 { // if ( !aDOMWindow ) @@ -78,7 +78,7 @@ Test06_raw( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) void // nsresult -Test06_raw_optimized( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) +Test06_raw_optimized( nsIDOMWindowInternal* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) // m332, w191 { // if ( !aDOMWindow ) @@ -119,7 +119,7 @@ Test06_raw_optimized( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWin } void -Test06_nsCOMPtr_as_found( nsIDOMWindow* aDOMWindow, nsCOMPtr* aWebShellWindow ) +Test06_nsCOMPtr_as_found( nsIDOMWindowInternal* aDOMWindow, nsCOMPtr* aWebShellWindow ) // m344, w181/201 { // if ( !aDOMWindow ) @@ -143,7 +143,7 @@ Test06_nsCOMPtr_as_found( nsIDOMWindow* aDOMWindow, nsCOMPtr* } void // nsresult -Test06_nsCOMPtr00( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) +Test06_nsCOMPtr00( nsIDOMWindowInternal* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) // m328, w191/199 { // if ( !aDOMWindow ) @@ -176,7 +176,7 @@ Test06_nsCOMPtr00( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow } void // nsresult -Test06_nsCOMPtr_optimized( nsIDOMWindow* aDOMWindow, nsCOMPtr* aWebShellWindow ) +Test06_nsCOMPtr_optimized( nsIDOMWindowInternal* aDOMWindow, nsCOMPtr* aWebShellWindow ) // m300, w176/182 { // if ( !aDOMWindow ) @@ -205,7 +205,7 @@ Test06_nsCOMPtr_optimized( nsIDOMWindow* aDOMWindow, nsCOMPtr } void // nsresult -Test06_nsCOMPtr02( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) +Test06_nsCOMPtr02( nsIDOMWindowInternal* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) // m320, w187/184 { // if ( !aDOMWindow ) @@ -242,7 +242,7 @@ Test06_nsCOMPtr02( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow } void // nsresult -Test06_nsCOMPtr03( nsIDOMWindow* aDOMWindow, nsCOMPtr* aWebShellWindow ) +Test06_nsCOMPtr03( nsIDOMWindowInternal* aDOMWindow, nsCOMPtr* aWebShellWindow ) // m332, w189/188 { // if ( !aDOMWindow ) @@ -277,7 +277,7 @@ Test06_nsCOMPtr03( nsIDOMWindow* aDOMWindow, nsCOMPtr* aWebSh } void // nsresult -Test06_nsIPtr( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) +Test06_nsIPtr( nsIDOMWindowInternal* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) // m564, w220 { // if ( !aDOMWindow ) @@ -307,7 +307,7 @@ Test06_nsIPtr( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) } void // nsresult -Test06_nsIPtr_optimized( nsIDOMWindow* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) +Test06_nsIPtr_optimized( nsIDOMWindowInternal* aDOMWindow, nsIWebShellWindow** aWebShellWindow ) // m400, w137 { // if ( !aDOMWindow ) diff --git a/xpfe/appshell/public/nsIAppShellService.idl b/xpfe/appshell/public/nsIAppShellService.idl index 43c9fa96532a..45c32f7ff360 100644 --- a/xpfe/appshell/public/nsIAppShellService.idl +++ b/xpfe/appshell/public/nsIAppShellService.idl @@ -138,18 +138,18 @@ interface nsIAppShellService : nsISupports * @param aResult the hidden window. Do not unhide hidden window. * Do not taunt hidden window. */ - nsIDOMWindow getHiddenDOMWindow(); + nsIDOMWindowInternal getHiddenDOMWindow(); /** - * Return the (singleton) application hidden window as an nsIDOMWindow, + * Return the (singleton) application hidden window as an nsIDOMWindowInternal, * and, the corresponding JavaScript context pointer. This is useful * if you'd like to subsequently call OpenDialog on the hidden window. - * @aHiddenDOMWindow the hidden window QI'd to type nsIDOMWindow + * @aHiddenDOMWindow the hidden window QI'd to type nsIDOMWindowInternal * @aJSContext the corresponding JavaScript context */ [noscript] - void GetHiddenWindowAndJSContext(out nsIDOMWindow aHiddenDOMWindow, + void GetHiddenWindowAndJSContext(out nsIDOMWindowInternal aHiddenDOMWindow, out JSContext aJSContext); /** diff --git a/xpfe/appshell/public/nsICommonDialogs.idl b/xpfe/appshell/public/nsICommonDialogs.idl index 00930234fcc0..29bd49cb5fc6 100644 --- a/xpfe/appshell/public/nsICommonDialogs.idl +++ b/xpfe/appshell/public/nsICommonDialogs.idl @@ -43,28 +43,28 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi /** * Puts up an alert dialog with an OK button. */ - void Alert(in nsIDOMWindow inParent, in wstring inDialogTitle, in wstring inMsg); + void Alert(in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg); /** * Puts up a dialog with OK button, and * a message with a single checkbox. * @return the value of the checkbox. */ - void AlertCheck(in nsIDOMWindow inParent, in wstring inDialogTitle, in wstring inMsg, + void AlertCheck(in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg, in wstring inCheckMsg, inout boolean outCheckValue); /** * Puts up a dialog with OK and Cancel buttons. * @return true for OK, false for Cancel */ - boolean Confirm(in nsIDOMWindow inParent, in wstring inDialogTitle, in wstring inMsg); + boolean Confirm(in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg); /** * Puts up a dialog with OK and Cancel buttons, and * a message with a single checkbox. * @return true for OK, false for Cancel */ - boolean ConfirmCheck(in nsIDOMWindow inParent, in wstring inDialogTitle, in wstring inMsg, + boolean ConfirmCheck(in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg, in wstring inCheckMsg, inout boolean outCheckValue); @@ -72,7 +72,7 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi * Puts up a text input dialog with OK and Cancel buttons. * @return true for OK, false for Cancel */ - boolean Prompt(in nsIDOMWindow inParent,in wstring inDialogTitle, in wstring inMsg, + boolean Prompt(in nsIDOMWindowInternal inParent,in wstring inDialogTitle, in wstring inMsg, in wstring inDefaultText, out wstring result); @@ -80,7 +80,7 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi * Puts up a username/password dialog with OK and Cancel buttons. * @return true for OK, false for Cancel */ - boolean PromptUsernameAndPassword(in nsIDOMWindow inParent, + boolean PromptUsernameAndPassword(in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg, out wstring outUser, @@ -90,7 +90,7 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi * Puts up a password dialog with OK and Cancel buttons. * @return true for OK, false for Cancel */ - boolean PromptPassword( in nsIDOMWindow inParent, + boolean PromptPassword( in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg, out wstring outPassword); @@ -98,7 +98,7 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi Puts up a dialog box which has a list box of strings. return true/false for OK/Cancel */ - boolean Select( in nsIDOMWindow inParent, + boolean Select( in nsIDOMWindowInternal inParent, in wstring inDialogTitle, in wstring inMsg, in PRUint32 inCount, @@ -109,7 +109,7 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi * Put up a universal dialog */ void UniversalDialog - (in nsIDOMWindow inParent, + (in nsIDOMWindowInternal inParent, in wstring inTitleMessage, in wstring inDialogTitle, /* e.g., alert, confirm, prompt, prompt password */ in wstring inMsg, /* main message for dialog */ @@ -132,7 +132,7 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi /* Core Dialog function */ - void DoDialog(in nsIDOMWindow inParent, in nsIDialogParamBlock ioParamBlock, in string inChromeURL ); + void DoDialog(in nsIDOMWindowInternal inParent, in nsIDialogParamBlock ioParamBlock, in string inChromeURL ); }; %{C++ diff --git a/xpfe/appshell/public/nsIWebShellWindow.h b/xpfe/appshell/public/nsIWebShellWindow.h index bc741a73c24f..229d0347e217 100644 --- a/xpfe/appshell/public/nsIWebShellWindow.h +++ b/xpfe/appshell/public/nsIWebShellWindow.h @@ -29,7 +29,7 @@ class nsIWebShell; class nsIWidget; class nsString; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIPrompt; // Interface ID for nsIWebShellWindow @@ -46,8 +46,8 @@ public: NS_IMETHOD Close() = 0; NS_IMETHOD GetWebShell(nsIWebShell *& aWebShell) = 0; NS_IMETHOD GetWidget(nsIWidget *& aWidget) = 0; - NS_IMETHOD GetDOMWindow(nsIDOMWindow** aDOMWindow) = 0; - NS_IMETHOD ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindow** aDOMWindow) = 0; + NS_IMETHOD GetDOMWindow(nsIDOMWindowInternal** aDOMWindow) = 0; + NS_IMETHOD ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindowInternal** aDOMWindow) = 0; NS_IMETHOD GetContentShellById(const nsString& anID, nsIWebShell** aResult) = 0; diff --git a/xpfe/appshell/public/nsIWindowMediator.idl b/xpfe/appshell/public/nsIWindowMediator.idl index b602ddd98815..2fbf7a65c997 100644 --- a/xpfe/appshell/public/nsIWindowMediator.idl +++ b/xpfe/appshell/public/nsIWindowMediator.idl @@ -56,15 +56,15 @@ interface nsIWindowMediator: nsIRDFDataSource Returns the window of type inType ( if null return any window type ) which has the most recent time stamp */ - nsIDOMWindow getMostRecentWindow( in wstring inType ); + nsIDOMWindowInternal getMostRecentWindow( in wstring inType ); /* Get window given an RDF resource. */ - nsIDOMWindow getWindowForResource( in wstring inResource ); + nsIDOMWindowInternal getWindowForResource( in wstring inResource ); /* */ - nsIDOMWindow convertISupportsToDOMWindow( in nsISupports inWindow ); + nsIDOMWindowInternal convertISupportsToDOMWindow( in nsISupports inWindow ); /* Add the webshellwindow to the list */ [noscript] void registerWindow( in nsIXULWindow inWindow); diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index 92cd02402f6b..e2c3811e3f75 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -38,7 +38,7 @@ #include "nsIAppShell.h" #include "nsIWidget.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIWebShellWindow.h" #include "nsWebShellWindow.h" @@ -210,7 +210,7 @@ nsAppShellService::CreateHiddenWindow() // succeed. NS_WITH_SERVICE(nsIXPConnect, xpc, kXPConnectCID, &rv); if (NS_FAILED(rv)) return rv; - nsCOMPtr junk; + nsCOMPtr junk; JSContext *cx; rv = GetHiddenWindowAndJSContext(getter_AddRefs(junk), &cx); if (NS_FAILED(rv)) return rv; @@ -408,8 +408,8 @@ nsAppShellService::Quit() if (NS_FAILED(rv)) break; - nsCOMPtr window = do_QueryInterface(isupports); - NS_ASSERTION(window != nsnull, "not an nsIDOMWindow"); + nsCOMPtr window = do_QueryInterface(isupports); + NS_ASSERTION(window != nsnull, "not an nsIDOMWindowInternal"); if (! window) continue; @@ -656,14 +656,14 @@ nsAppShellService::GetHiddenWindow(nsIXULWindow **aWindow) } NS_IMETHODIMP -nsAppShellService::GetHiddenDOMWindow(nsIDOMWindow **aWindow) +nsAppShellService::GetHiddenDOMWindow(nsIDOMWindowInternal **aWindow) { nsresult rv; nsCOMPtr docShell; rv = mHiddenWindow->GetDocShell(getter_AddRefs(docShell)); if (NS_FAILED(rv)) return rv; - nsCOMPtr hiddenDOMWindow(do_GetInterface(docShell, &rv)); + nsCOMPtr hiddenDOMWindow(do_GetInterface(docShell, &rv)); if (NS_FAILED(rv)) return rv; *aWindow = hiddenDOMWindow; @@ -672,7 +672,7 @@ nsAppShellService::GetHiddenDOMWindow(nsIDOMWindow **aWindow) } NS_IMETHODIMP -nsAppShellService::GetHiddenWindowAndJSContext(nsIDOMWindow **aWindow, +nsAppShellService::GetHiddenWindowAndJSContext(nsIDOMWindowInternal **aWindow, JSContext **aJSContext) { nsresult rv = NS_OK; @@ -681,15 +681,15 @@ nsAppShellService::GetHiddenWindowAndJSContext(nsIDOMWindow **aWindow, *aJSContext = nsnull; if ( mHiddenWindow ) { - // Convert hidden window to nsIDOMWindow and extract its JSContext. + // Convert hidden window to nsIDOMWindowInternal and extract its JSContext. do { // 1. Get doc for hidden window. nsCOMPtr docShell; rv = mHiddenWindow->GetDocShell(getter_AddRefs(docShell)); if (NS_FAILED(rv)) break; - // 2. Convert that to an nsIDOMWindow. - nsCOMPtr hiddenDOMWindow(do_GetInterface(docShell)); + // 2. Convert that to an nsIDOMWindowInternal. + nsCOMPtr hiddenDOMWindow(do_GetInterface(docShell)); if(!hiddenDOMWindow) break; // 3. Get script global object for the window. diff --git a/xpfe/appshell/src/nsCommandLineServiceMac.cpp b/xpfe/appshell/src/nsCommandLineServiceMac.cpp index 34eacfc4d7ff..2e4c85d06480 100644 --- a/xpfe/appshell/src/nsCommandLineServiceMac.cpp +++ b/xpfe/appshell/src/nsCommandLineServiceMac.cpp @@ -39,7 +39,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #include "nsIWebShellWindow.h" #include "nsIWebShell.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "jsapi.h" #include "nsAEEventHandling.h" @@ -301,7 +301,7 @@ nsresult nsMacCommandLine::OpenWindow(const char *chrome, const PRUnichar *url) NS_WITH_SERVICE(nsIAppShellService, appShellService, kAppShellServiceCID, &rv) if (NS_SUCCEEDED(rv)) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext *jsContext; rv = appShellService->GetHiddenWindowAndJSContext( getter_AddRefs( hiddenWindow ), &jsContext ); @@ -317,7 +317,7 @@ nsresult nsMacCommandLine::OpenWindow(const char *chrome, const PRUnichar *url) url ); if(argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog( jsContext, argv, 4, diff --git a/xpfe/appshell/src/nsCommonDialogs.cpp b/xpfe/appshell/src/nsCommonDialogs.cpp index a77caf63f3cb..87e5faa6cc47 100644 --- a/xpfe/appshell/src/nsCommonDialogs.cpp +++ b/xpfe/appshell/src/nsCommonDialogs.cpp @@ -20,7 +20,7 @@ * Contributor(s): * Pierre Phaneuf */ -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsCommonDialogs.h" #include "nsCOMPtr.h" #include "nsIScriptGlobalObject.h" @@ -47,7 +47,7 @@ nsCommonDialogs::~nsCommonDialogs() { } -NS_IMETHODIMP nsCommonDialogs::Alert(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg) +NS_IMETHODIMP nsCommonDialogs::Alert(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -75,7 +75,7 @@ NS_IMETHODIMP nsCommonDialogs::Alert(nsIDOMWindow *inParent, const PRUnichar *i -NS_IMETHODIMP nsCommonDialogs::AlertCheck(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle,const PRUnichar *inMsg, const PRUnichar *inCheckMsg, PRBool *outCheckValue) +NS_IMETHODIMP nsCommonDialogs::AlertCheck(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle,const PRUnichar *inMsg, const PRUnichar *inCheckMsg, PRBool *outCheckValue) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -106,7 +106,7 @@ NS_IMETHODIMP nsCommonDialogs::AlertCheck(nsIDOMWindow *inParent, const PRUnich return rv; } -NS_IMETHODIMP nsCommonDialogs::Confirm(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRBool *_retval) +NS_IMETHODIMP nsCommonDialogs::Confirm(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRBool *_retval) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -135,7 +135,7 @@ NS_IMETHODIMP nsCommonDialogs::Confirm(nsIDOMWindow *inParent, const PRUnichar * return rv; } -NS_IMETHODIMP nsCommonDialogs::ConfirmCheck(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle,const PRUnichar *inMsg, const PRUnichar *inCheckMsg, PRBool *outCheckValue, PRBool *_retval) +NS_IMETHODIMP nsCommonDialogs::ConfirmCheck(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle,const PRUnichar *inMsg, const PRUnichar *inCheckMsg, PRBool *outCheckValue, PRBool *_retval) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -174,7 +174,7 @@ NS_IMETHODIMP nsCommonDialogs::ConfirmCheck(nsIDOMWindow *inParent, const PRUni a few bytes of memory */ NS_IMETHODIMP nsCommonDialogs::UniversalDialog - (nsIDOMWindow *inParent, + (nsIDOMWindowInternal *inParent, const PRUnichar *inTitleMessage, const PRUnichar *inDialogTitle, /* e.g., alert, confirm, prompt, prompt password */ const PRUnichar *inMsg, /* main message for dialog */ @@ -277,7 +277,7 @@ NS_IMETHODIMP nsCommonDialogs::UniversalDialog return rv; } -NS_IMETHODIMP nsCommonDialogs::Prompt(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, const PRUnichar *inDefaultText, PRUnichar **result, PRBool *_retval) +NS_IMETHODIMP nsCommonDialogs::Prompt(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, const PRUnichar *inDefaultText, PRUnichar **result, PRBool *_retval) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -311,7 +311,7 @@ NS_IMETHODIMP nsCommonDialogs::Prompt(nsIDOMWindow *inParent, const PRUnichar *i return rv; } -NS_IMETHODIMP nsCommonDialogs::PromptUsernameAndPassword(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRUnichar **outUser, PRUnichar **outPassword, PRBool *_retval) +NS_IMETHODIMP nsCommonDialogs::PromptUsernameAndPassword(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRUnichar **outUser, PRUnichar **outPassword, PRBool *_retval) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -346,7 +346,7 @@ NS_IMETHODIMP nsCommonDialogs::PromptUsernameAndPassword(nsIDOMWindow *inParent, return rv; } -NS_IMETHODIMP nsCommonDialogs::PromptPassword(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRUnichar **outPassword, PRBool *_retval) +NS_IMETHODIMP nsCommonDialogs::PromptPassword(nsIDOMWindowInternal *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRUnichar **outPassword, PRBool *_retval) { nsresult rv; nsIDialogParamBlock* block = NULL; @@ -379,7 +379,7 @@ NS_IMETHODIMP nsCommonDialogs::PromptPassword(nsIDOMWindow *inParent, const PRU -nsresult nsCommonDialogs::Select(nsIDOMWindow *inParent, const PRUnichar *inDialogTitle, const PRUnichar* inMsg, PRUint32 inCount, const PRUnichar **inList, PRInt32 *outSelection, PRBool *_retval) +nsresult nsCommonDialogs::Select(nsIDOMWindowInternal *inParent, const PRUnichar *inDialogTitle, const PRUnichar* inMsg, PRUint32 inCount, const PRUnichar **inList, PRInt32 *outSelection, PRBool *_retval) { nsresult rv; const PRInt32 eSelection = 2 ; @@ -422,7 +422,7 @@ nsresult nsCommonDialogs::Select(nsIDOMWindow *inParent, const PRUnichar *inDial } - NS_IMETHODIMP nsCommonDialogs::DoDialog(nsIDOMWindow* inParent, nsIDialogParamBlock *ioParamBlock, const char *inChromeURL) + NS_IMETHODIMP nsCommonDialogs::DoDialog(nsIDOMWindowInternal* inParent, nsIDialogParamBlock *ioParamBlock, const char *inChromeURL) { nsresult rv = NS_OK; @@ -449,7 +449,7 @@ nsresult nsCommonDialogs::Select(nsIDOMWindow *inParent, const PRUnichar *inDial (nsISupports*)ioParamBlock ); if ( argv ) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = inParent->OpenDialog( jsContext, argv, 4, getter_AddRefs(newWindow) ); JS_PopArguments( jsContext, stackPtr ); } diff --git a/xpfe/appshell/src/nsContentTreeOwner.cpp b/xpfe/appshell/src/nsContentTreeOwner.cpp index d8f9097e6aa1..7fefb3eaa90c 100644 --- a/xpfe/appshell/src/nsContentTreeOwner.cpp +++ b/xpfe/appshell/src/nsContentTreeOwner.cpp @@ -31,7 +31,7 @@ #include "nsIDOMNode.h" #include "nsIDOMElement.h" #include "nsIDOMNodeList.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULElement.h" #include "nsIPrompt.h" #include "nsIWindowMediator.h" @@ -200,7 +200,7 @@ NS_IMETHODIMP nsContentTreeOwner::GetNewWindow(PRInt32 aChromeFlags, NS_IMETHODIMP nsContentTreeOwner::SetStatus(PRUint32 aStatusType, const PRUnichar* aStatus) { - nsCOMPtr domWindow; + nsCOMPtr domWindow; mXULWindow->GetWindowDOMWindow(getter_AddRefs(domWindow)); nsCOMPtr piDOMWindow(do_QueryInterface(domWindow)); if(!piDOMWindow) diff --git a/xpfe/appshell/src/nsNetSupportDialog.cpp b/xpfe/appshell/src/nsNetSupportDialog.cpp index 699292b8a07b..4c8d3d72012b 100644 --- a/xpfe/appshell/src/nsNetSupportDialog.cpp +++ b/xpfe/appshell/src/nsNetSupportDialog.cpp @@ -31,7 +31,7 @@ //Interfaces Needed #include "nsIAppShellService.h" #include "nsICommonDialogs.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIServiceManager.h" #include "nsIXULWindow.h" #include "nsIInterfaceRequestor.h" diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index ca47772ea3bc..d23f7b63fc31 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -40,7 +40,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #include "nsEscape.h" #include "nsVoidArray.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsPIDOMWindow.h" #include "nsIDOMEventTarget.h" #include "nsIDOMFocusListener.h" @@ -485,7 +485,7 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent) if (!data) break; - nsCOMPtr domWindow; + nsCOMPtr domWindow; nsCOMPtr contentShell; ((nsWebShellWindow *)data)->GetContentWebShell(getter_AddRefs(contentShell)); if (contentShell) { @@ -518,7 +518,7 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent) break; nsCOMPtr domDocument; - nsCOMPtr domWindow; + nsCOMPtr domWindow; ((nsWebShellWindow *)data)->ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow)); domWindow->GetDocument(getter_AddRefs(domDocument)); nsCOMPtr xulDoc = do_QueryInterface(domDocument); @@ -526,7 +526,7 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent) nsCOMPtr commandDispatcher; xulDoc->GetCommandDispatcher(getter_AddRefs(commandDispatcher)); if (commandDispatcher) { - nsCOMPtr focusedWindow; + nsCOMPtr focusedWindow; commandDispatcher->GetFocusedWindow(getter_AddRefs(focusedWindow)); if (focusedWindow) { commandDispatcher->SetSuppressFocus(PR_TRUE); @@ -1068,7 +1068,7 @@ nsWebShellWindow::GetContentShellById(const nsString& aID, nsIWebShell** aChildS //------------------------------------------------------------------------------ NS_IMETHODIMP -nsWebShellWindow::ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindow** aDOMWindow) +nsWebShellWindow::ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindowInternal** aDOMWindow) { nsCOMPtr globalObjectOwner(do_QueryInterface(aShell)); NS_ENSURE_TRUE(globalObjectOwner, NS_ERROR_FAILURE); @@ -1077,7 +1077,7 @@ nsWebShellWindow::ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindow** globalObjectOwner->GetScriptGlobalObject(getter_AddRefs(globalObject)); NS_ENSURE_TRUE(globalObject, NS_ERROR_FAILURE); - nsCOMPtr newDOMWindow(do_QueryInterface(globalObject)); + nsCOMPtr newDOMWindow(do_QueryInterface(globalObject)); NS_ENSURE_TRUE(newDOMWindow, NS_ERROR_FAILURE); *aDOMWindow = newDOMWindow.get(); @@ -1153,7 +1153,7 @@ nsWebShellWindow::GetWidget(nsIWidget *& aWidget) } NS_IMETHODIMP -nsWebShellWindow::GetDOMWindow(nsIDOMWindow** aDOMWindow) +nsWebShellWindow::GetDOMWindow(nsIDOMWindowInternal** aDOMWindow) { return ConvertWebShellToDOMWindow(mWebShell, aDOMWindow); } @@ -1748,7 +1748,7 @@ NS_IMETHODIMP nsWebShellWindow::Destroy() // - somewhere along the way a real dialog comes up // // This little transducer maps the nsIPrompt interface to the nsICommonDialogs -// interface. Ideally, nsIPrompt would be implemented by nsIDOMWindow which +// interface. Ideally, nsIPrompt would be implemented by nsIDOMWindowInternal which // would eliminate the need for this. class nsDOMWindowPrompter : public nsIPrompt @@ -1757,18 +1757,18 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIPROMPT - nsDOMWindowPrompter(nsIDOMWindow* window); + nsDOMWindowPrompter(nsIDOMWindowInternal* window); virtual ~nsDOMWindowPrompter() {} nsresult Init(); protected: - nsCOMPtr mDOMWindow; + nsCOMPtr mDOMWindow; nsCOMPtr mCommonDialogs; }; static nsresult -NS_NewDOMWindowPrompter(nsIPrompt* *result, nsIDOMWindow* window) +NS_NewDOMWindowPrompter(nsIPrompt* *result, nsIDOMWindowInternal* window) { nsresult rv; nsDOMWindowPrompter* prompter = new nsDOMWindowPrompter(window); @@ -1786,7 +1786,7 @@ NS_NewDOMWindowPrompter(nsIPrompt* *result, nsIDOMWindow* window) NS_IMPL_THREADSAFE_ISUPPORTS1(nsDOMWindowPrompter, nsIPrompt) -nsDOMWindowPrompter::nsDOMWindowPrompter(nsIDOMWindow* window) +nsDOMWindowPrompter::nsDOMWindowPrompter(nsIDOMWindowInternal* window) : mDOMWindow(window) { NS_INIT_REFCNT(); @@ -1972,7 +1972,7 @@ nsWebShellWindow::GetPrompter(nsIPrompt* *result) nsIWebShell* tempWebShell; GetWebShell(tempWebShell); nsCOMPtr webShell(dont_AddRef(tempWebShell)); - nsCOMPtr domWindow; + nsCOMPtr domWindow; rv = ConvertWebShellToDOMWindow(webShell, getter_AddRefs(domWindow)); if (NS_FAILED(rv)) { NS_ERROR("Unable to retrieve the DOM window from the new web shell."); diff --git a/xpfe/appshell/src/nsWebShellWindow.h b/xpfe/appshell/src/nsWebShellWindow.h index 5e4d6e4568c8..96b42c633048 100644 --- a/xpfe/appshell/src/nsWebShellWindow.h +++ b/xpfe/appshell/src/nsWebShellWindow.h @@ -50,7 +50,7 @@ class nsIContent; class nsIDocument; class nsIDOMCharacterData; class nsIDOMElement; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDOMHTMLImageElement; class nsIDOMHTMLInputElement; class nsIStreamObserver; @@ -85,8 +85,8 @@ public: NS_IMETHOD GetWebShell(nsIWebShell *& aWebShell); NS_IMETHOD GetContentWebShell(nsIWebShell **aResult); NS_IMETHOD GetWidget(nsIWidget *& aWidget); - NS_IMETHOD GetDOMWindow(nsIDOMWindow** aDOMWindow); - NS_IMETHOD ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindow** aDOMWindow); + NS_IMETHOD GetDOMWindow(nsIDOMWindowInternal** aDOMWindow); + NS_IMETHOD ConvertWebShellToDOMWindow(nsIWebShell* aShell, nsIDOMWindowInternal** aDOMWindow); NS_IMETHOD GetPrompter(nsIPrompt* *result); // nsWebShellWindow methods... nsresult Initialize(nsIXULWindow * aParent, nsIAppShell* aShell, nsIURI* aUrl, diff --git a/xpfe/appshell/src/nsWindowMediator.cpp b/xpfe/appshell/src/nsWindowMediator.cpp index c5c2f656407a..ff2a30b746be 100644 --- a/xpfe/appshell/src/nsWindowMediator.cpp +++ b/xpfe/appshell/src/nsWindowMediator.cpp @@ -27,7 +27,7 @@ #include "nsVoidArray.h" #include "rdf.h" #include "nsIBaseWindow.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMElement.h" #include "nsIDocumentViewer.h" #include "nsIDocument.h" @@ -64,7 +64,7 @@ DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, URL); static nsIRDFService* gRDFService = nsnull; static nsresult GetDOMWindow( nsIXULWindow* inWindow, - nsCOMPtr< nsIDOMWindow>& outDOMWindow ); + nsCOMPtr< nsIDOMWindowInternal>& outDOMWindow ); static nsCOMPtr GetDOMNodeFromDocShell(nsIDocShell *aShell); static void GetAttribute( nsIXULWindow* inWindow, const nsAutoString& inAttribute, nsAutoString& outValue ); @@ -90,7 +90,7 @@ nsresult NS_NewRDFContainer(nsIRDFDataSource* aDataSource, return rv; } -nsresult GetDOMWindow( nsIXULWindow* inWindow, nsCOMPtr< nsIDOMWindow>& outDOMWindow ) +nsresult GetDOMWindow( nsIXULWindow* inWindow, nsCOMPtr< nsIDOMWindowInternal>& outDOMWindow ) { nsCOMPtr docShell; @@ -317,7 +317,7 @@ NS_IMETHODIMP nsWindowEnumerator::GetNext(nsISupports **retval) if(mEnumXULWindow) CallQueryInterface(mCurrentPosition->mWindow, retval); else { - nsCOMPtr domWindow; + nsCOMPtr domWindow; GetDOMWindow(mCurrentPosition->mWindow, domWindow); CallQueryInterface(domWindow, retval); } @@ -532,7 +532,7 @@ PRInt32 nsWindowMediator::RemoveEnumerator( nsWindowEnumerator* 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 PRUnichar* inType, nsIDOMWindow** outWindow ) { +NS_IMETHODIMP nsWindowMediator::GetMostRecentWindow( const PRUnichar* inType, nsIDOMWindowInternal** outWindow ) { *outWindow = NULL; PRInt32 lastTimeStamp = -1; @@ -560,7 +560,7 @@ NS_IMETHODIMP nsWindowMediator::GetMostRecentWindow( const PRUnichar* inType, ns } if (mostRecentWindow) { - nsCOMPtr DOMWindow; + nsCOMPtr DOMWindow; if( NS_SUCCEEDED ( GetDOMWindow( mostRecentWindow, DOMWindow ) ) ) { *outWindow = DOMWindow; (*outWindow)->AddRef(); @@ -863,7 +863,7 @@ NS_IMETHODIMP nsWindowMediator::SetZPosition( return NS_OK; } -NS_IMETHODIMP nsWindowMediator::GetWindowForResource( const PRUnichar* inResource, nsIDOMWindow** outWindow ) +NS_IMETHODIMP nsWindowMediator::GetWindowForResource( const PRUnichar* inResource, nsIDOMWindowInternal** outWindow ) { if ( outWindow == NULL ) return NS_ERROR_INVALID_ARG; @@ -885,7 +885,7 @@ NS_IMETHODIMP nsWindowMediator::GetWindowForResource( const PRUnichar* inResour if ( NS_SUCCEEDED( info->mRDFID->EqualsString( resourceString, &isMatch) ) && isMatch ) { - nsCOMPtr DOMWindow; + nsCOMPtr DOMWindow; if( NS_SUCCEEDED ( GetDOMWindow( info->mWindow, DOMWindow ) ) ) { *outWindow = DOMWindow; @@ -905,9 +905,9 @@ NS_IMETHODIMP nsWindowMediator::GetWindowForResource( const PRUnichar* inResour return NS_OK; } -NS_IMETHODIMP nsWindowMediator::ConvertISupportsToDOMWindow( nsISupports* inInterface, nsIDOMWindow** outWindow ) +NS_IMETHODIMP nsWindowMediator::ConvertISupportsToDOMWindow( nsISupports* inInterface, nsIDOMWindowInternal** outWindow ) { - return inInterface->QueryInterface(NS_GET_IID(nsIDOMWindow) , (void**) outWindow ); + return inInterface->QueryInterface(NS_GET_IID(nsIDOMWindowInternal) , (void**) outWindow ); } diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index 2d9c9405740e..f3bc03903dd8 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -38,7 +38,7 @@ #include "nsIDocument.h" #include "nsIDOMDocument.h" #include "nsIDOMElement.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMXULDocument.h" #include "nsIInterfaceRequestor.h" #include "nsIIOService.h" @@ -834,7 +834,7 @@ NS_IMETHODIMP nsXULWindow::PersistPositionAndSize(PRBool aPosition, PRBool aSize return NS_OK; } -NS_IMETHODIMP nsXULWindow::GetWindowDOMWindow(nsIDOMWindow** aDOMWindow) +NS_IMETHODIMP nsXULWindow::GetWindowDOMWindow(nsIDOMWindowInternal** aDOMWindow) { NS_ENSURE_STATE(mDocShell); @@ -1182,9 +1182,9 @@ void nsXULWindow::ActivateParent() { if (!windowMediator) return; - nsCOMPtr topDOMWindow; + nsCOMPtr topDOMWindow; windowMediator->GetMostRecentWindow(nsnull, getter_AddRefs(topDOMWindow)); - nsCOMPtr ourDOMWindow(do_GetInterface(mDocShell)); + nsCOMPtr ourDOMWindow(do_GetInterface(mDocShell)); if (ourDOMWindow != topDOMWindow) return; diff --git a/xpfe/appshell/src/nsXULWindow.h b/xpfe/appshell/src/nsXULWindow.h index 1a20da20256f..e1317afc8dad 100644 --- a/xpfe/appshell/src/nsXULWindow.h +++ b/xpfe/appshell/src/nsXULWindow.h @@ -37,7 +37,7 @@ #include "nsIBaseWindow.h" #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIEventQueueService.h" #include "nsIInterfaceRequestor.h" #include "nsIWidget.h" @@ -72,7 +72,7 @@ protected: NS_IMETHOD LoadTitleFromXUL(); NS_IMETHOD PersistPositionAndSize(PRBool aPosition, PRBool aSize, PRBool aSizeMode); - NS_IMETHOD GetWindowDOMWindow(nsIDOMWindow** aDOMWindow); + NS_IMETHOD GetWindowDOMWindow(nsIDOMWindowInternal** aDOMWindow); NS_IMETHOD GetWindowDOMElement(nsIDOMElement** aDOMElement); NS_IMETHOD GetDOMElementById(char* aID, nsIDOMElement** aDOMElement); NS_IMETHOD ContentShellAdded(nsIDocShellTreeItem* aContentShell, @@ -99,7 +99,7 @@ protected: nsContentTreeOwner* mPrimaryContentTreeOwner; nsCOMPtr mWindow; nsCOMPtr mDocShell; - nsCOMPtr mDOMWindow; + nsCOMPtr mDOMWindow; nsCOMPtr mParentWindow; nsVoidArray mContentShells; PRBool mContinueModalLoop; diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index c929c7fef966..49fd1a6ee45b 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -44,7 +44,7 @@ #include "nsSpecialSystemDirectory.h" #include "nsIWalletService.h" #include "nsIWindowMediator.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIClipboard.h" #include "nsISoftwareUpdate.h" #include "nsSoftwareUpdateIIDs.h" @@ -219,7 +219,7 @@ static nsresult OpenWindow( const char*urlstr, const PRUnichar *args ) nsresult rv; nsCOMPtr appShellService = do_GetService(kAppShellServiceCID, &rv); if (NS_SUCCEEDED(rv)) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext *jsContext; rv = appShellService->GetHiddenWindowAndJSContext(getter_AddRefs(hiddenWindow), &jsContext); @@ -234,7 +234,7 @@ static nsresult OpenWindow( const char*urlstr, const PRUnichar *args ) args ); if( argv ) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog( jsContext, argv, 4, @@ -919,7 +919,7 @@ static nsresult main1(int argc, char* argv[], nsISupports *nativeApp ) } // rjc: now must explicitly call appshell's CreateHiddenWindow() function AFTER profile manager. - // if the profile manager ever switches to using nsIDOMWindow stuff, this might have to change + // if the profile manager ever switches to using nsIDOMWindowInternal stuff, this might have to change appShell->CreateHiddenWindow(); // Enumerate AppShellComponenets diff --git a/xpfe/bootstrap/nsNativeAppSupportWin.cpp b/xpfe/bootstrap/nsNativeAppSupportWin.cpp index bd938b677bc6..8bef21ba6b83 100644 --- a/xpfe/bootstrap/nsNativeAppSupportWin.cpp +++ b/xpfe/bootstrap/nsNativeAppSupportWin.cpp @@ -30,7 +30,7 @@ #include "nsIServiceManager.h" #include "nsIAppShellService.h" #include "nsAppShellCIDs.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include #include #include @@ -1014,7 +1014,7 @@ nsNativeAppSupportWin::OpenWindow( const char*urlstr, const char *args ) { static NS_DEFINE_CID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID ); NS_WITH_SERVICE(nsIAppShellService, appShellService, kAppShellServiceCID, &rv) if ( NS_SUCCEEDED( rv ) ) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext *jsContext; rv = appShellService->GetHiddenWindowAndJSContext( getter_AddRefs( hiddenWindow ), &jsContext ); @@ -1028,7 +1028,7 @@ nsNativeAppSupportWin::OpenWindow( const char*urlstr, const char *args ) { "chrome,dialog=no,all", args ); if( argv ) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog( jsContext, argv, 4, diff --git a/xpfe/browser/public/nsIBrowserInstance.idl b/xpfe/browser/public/nsIBrowserInstance.idl index 68fc2f61dbe6..a7f8b85e1923 100644 --- a/xpfe/browser/public/nsIBrowserInstance.idl +++ b/xpfe/browser/public/nsIBrowserInstance.idl @@ -47,18 +47,18 @@ interface nsIBrowserInstance : nsISupports { void updateGoMenu(in nsIDOMNode goMenu); // Wallet (should reside elsewhere, somehow). - boolean walletPreview(in nsIDOMWindow win, in nsIDOMWindow form); + boolean walletPreview(in nsIDOMWindowInternal win, in nsIDOMWindowInternal form); boolean walletChangePassword(); - boolean walletQuickFillin(in nsIDOMWindow win); - PRUint32 walletRequestToCapture(in nsIDOMWindow win); + boolean walletQuickFillin(in nsIDOMWindowInternal win); + PRUint32 walletRequestToCapture(in nsIDOMWindowInternal win); // Infrastructure. void init(); - void setContentWindow( in nsIDOMWindow aWindow ); + void setContentWindow( in nsIDOMWindowInternal aWindow ); void getContentDocShell(out nsIDocShell aDocShell); - void setWebShellWindow( in nsIDOMWindow aWindow ); + void setWebShellWindow( in nsIDOMWindowInternal aWindow ); void setTextZoom( in float aTextZoom ); void SetDocumentCharset(in wstring charset); wstring GetDocumentCharset(); diff --git a/xpfe/browser/src/nsBrowserInstance.cpp b/xpfe/browser/src/nsBrowserInstance.cpp index b4f26c785056..33fedd10166e 100644 --- a/xpfe/browser/src/nsBrowserInstance.cpp +++ b/xpfe/browser/src/nsBrowserInstance.cpp @@ -52,7 +52,7 @@ #include "nsIDOMDocument.h" #include "nsIDOMXULDocument.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIContentViewer.h" @@ -421,7 +421,7 @@ nsBrowserInstance::~nsBrowserInstance() void nsBrowserInstance::ReinitializeContentVariables() { - nsCOMPtr content; + nsCOMPtr content; mDOMWindow->Get_content(getter_AddRefs(content)); SetContentWindow(content); } @@ -447,10 +447,10 @@ nsBrowserInstance::GetContentAreaDocShell() return docShell.get(); } -nsIDOMWindow* +nsIDOMWindowInternal* nsBrowserInstance::GetContentWindow() { - nsCOMPtr domWindow(do_QueryReferent(mContentWindowWeak)); + nsCOMPtr domWindow(do_QueryReferent(mContentWindowWeak)); if (!domWindow) ReinitializeContentVariables(); domWindow = do_QueryReferent(mContentWindowWeak); @@ -864,7 +864,7 @@ nsBrowserInstance::GotoHistoryIndex(PRInt32 aIndex) } NS_IMETHODIMP -nsBrowserInstance::WalletPreview(nsIDOMWindow* aWin, nsIDOMWindow* aForm, PRBool* status) +nsBrowserInstance::WalletPreview(nsIDOMWindowInternal* aWin, nsIDOMWindowInternal* aForm, PRBool* status) { NS_PRECONDITION(aForm != nsnull, "null ptr"); if (! aForm) @@ -910,7 +910,7 @@ nsBrowserInstance::WalletPreview(nsIDOMWindow* aWin, nsIDOMWindow* aForm, PRBool "chrome,modal=yes,dialog=yes,all,width=504,height=436"); NS_ENSURE_TRUE(argv, NS_ERROR_FAILURE); - nsCOMPtr newWindow; + nsCOMPtr newWindow; aWin->OpenDialog(jsContext, argv, 3, getter_AddRefs(newWindow)); JS_PopArguments(jsContext, mark); @@ -935,7 +935,7 @@ nsBrowserInstance::WalletChangePassword(PRBool* status) #include "nsIDOMHTMLDocument.h" static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID); NS_IMETHODIMP -nsBrowserInstance::WalletQuickFillin(nsIDOMWindow* aWin, PRBool* status) +nsBrowserInstance::WalletQuickFillin(nsIDOMWindowInternal* aWin, PRBool* status) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (! aWin) @@ -964,7 +964,7 @@ nsBrowserInstance::WalletQuickFillin(nsIDOMWindow* aWin, PRBool* status) } NS_IMETHODIMP -nsBrowserInstance::WalletRequestToCapture(nsIDOMWindow* aWin, PRUint32* status) +nsBrowserInstance::WalletRequestToCapture(nsIDOMWindowInternal* aWin, PRUint32* status) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (! aWin) @@ -1008,7 +1008,7 @@ nsBrowserInstance::Init() } NS_IMETHODIMP -nsBrowserInstance::SetContentWindow(nsIDOMWindow* aWin) +nsBrowserInstance::SetContentWindow(nsIDOMWindowInternal* aWin) { NS_PRECONDITION(aWin != nsnull, "null ptr"); if (! aWin) @@ -1110,7 +1110,7 @@ nsBrowserInstance::GetUrlbarHistory(nsIUrlbarHistory** aUrlbarHistory) } NS_IMETHODIMP -nsBrowserInstance::SetWebShellWindow(nsIDOMWindow* aWin) +nsBrowserInstance::SetWebShellWindow(nsIDOMWindowInternal* aWin) { NS_ENSURE_ARG(aWin); mDOMWindow = aWin; @@ -2265,7 +2265,7 @@ NS_IMETHODIMP nsBrowserContentHandler::HandleContent(const char * aContentType, // we need a dom window to create the new browser window...in order // to do this, we need to get the window mediator service and ask it for a dom window NS_ENSURE_ARG(aChannel); - nsCOMPtr parentWindow; + nsCOMPtr parentWindow; JSContext* jsContext = nsnull; if (aWindowContext) @@ -2319,7 +2319,7 @@ NS_IMETHODIMP nsBrowserContentHandler::HandleContent(const char * aContentType, argv = JS_PushArguments(jsContext, &mark, "Ws", value.GetUnicode(), windowTarget); NS_ENSURE_TRUE(argv, NS_ERROR_FAILURE); - nsCOMPtr newWindow; + nsCOMPtr newWindow; parentWindow->Open(jsContext, argv, 2, getter_AddRefs(newWindow)); JS_PopArguments(jsContext, mark); @@ -2461,7 +2461,7 @@ int PR_CALLBACK ButtonShowHideCallback(const char* aPref, void* aClosure) nsCOMPtr protoWindow; windowEnumerator->GetNext(getter_AddRefs(protoWindow)); if (protoWindow) { - nsCOMPtr domWindow = do_QueryInterface(protoWindow); + nsCOMPtr domWindow = do_QueryInterface(protoWindow); if (domWindow) { nsCOMPtr doc; domWindow->GetDocument(getter_AddRefs(doc)); diff --git a/xpfe/browser/src/nsBrowserInstance.h b/xpfe/browser/src/nsBrowserInstance.h index e959045234ad..14b1eb601836 100644 --- a/xpfe/browser/src/nsBrowserInstance.h +++ b/xpfe/browser/src/nsBrowserInstance.h @@ -50,7 +50,7 @@ class nsIDocShell; class nsIScriptContext; -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIDOMNode; class nsIURI; class nsIWebShellWindow; @@ -94,7 +94,7 @@ class nsBrowserInstance : public nsIBrowserInstance, public: nsIDocShell* GetContentAreaDocShell(); - nsIDOMWindow* GetContentWindow(); + nsIDOMWindowInternal* GetContentWindow(); nsIDocumentLoader* GetContentAreaDocLoader(); void ReinitializeContentVariables(); @@ -118,7 +118,7 @@ class nsBrowserInstance : public nsIBrowserInstance, nsIWebShellWindow *mWebShellWin; // weak reference nsIDocShell * mDocShell; // weak reference - nsIDOMWindow* mDOMWindow; // weak reference + nsIDOMWindowInternal* mDOMWindow; // weak reference nsCOMPtr mUrlbarHistory; //We own this nsCOMPtr mSearchContext; // at last, something we really own diff --git a/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/xpfe/components/bookmarks/src/nsBookmarksService.cpp index bfed9a4f2ac7..a638cb356b3e 100644 --- a/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -36,7 +36,7 @@ #include "nsCRT.h" #include "nsFileStream.h" #include "nsIComponentManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIGenericFactory.h" #include "nsIProfile.h" #include "nsIRDFContainer.h" @@ -2393,7 +2393,7 @@ nsBookmarksService::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, { parent->GetDocShell(getter_AddRefs(docShell)); } - nsCOMPtr domParent(do_GetInterface(docShell)); + nsCOMPtr domParent(do_GetInterface(docShell)); nsCOMPtr sgo(do_QueryInterface(domParent)); nsCOMPtr context; @@ -2411,7 +2411,7 @@ nsBookmarksService::OnStopRequest(nsIChannel* channel, nsISupports *ctxt, if (argv) { // open the window - nsIDOMWindow *newWindow; + nsIDOMWindowInternal *newWindow; domParent->Open(jsContext, argv, 1, &newWindow); JS_PopArguments(jsContext, stackPtr); } diff --git a/xpfe/components/find/public/nsIFindComponent.idl b/xpfe/components/find/public/nsIFindComponent.idl index b433e66e4623..6b24523866f7 100644 --- a/xpfe/components/find/public/nsIFindComponent.idl +++ b/xpfe/components/find/public/nsIFindComponent.idl @@ -25,7 +25,7 @@ #include "nsIEditorShell.idl" %{C++ -class nsIDOMWindow; +class nsIDOMWindowInternal; class nsIEditorShell; %} @@ -74,7 +74,7 @@ interface nsIFindComponent : nsIAppShellComponent | Clients do have to call Release() when they're no longer interested in | | this search context. | --------------------------------------------------------------------------*/ - nsISupports CreateContext(in nsIDOMWindow aWindow, in nsIEditorShell aEditor); + nsISupports CreateContext(in nsIDOMWindowInternal aWindow, in nsIEditorShell aEditor); /*--------------------------------- Find ----------------------------------- | Finds the "first" occurrence of a string in the given search context | @@ -112,7 +112,7 @@ interface nsIFindComponent : nsIAppShellComponent | this will be the equivalent of calling Release() on the old context and | | then creating a new one for aNewWebShell. | --------------------------------------------------------------------------*/ - void ResetContext(in nsISupports aContext, in nsIDOMWindow aWindow, + void ResetContext(in nsISupports aContext, in nsIDOMWindowInternal aWindow, in nsIEditorShell aEditor ); }; diff --git a/xpfe/components/find/public/nsISearchContext.idl b/xpfe/components/find/public/nsISearchContext.idl index b076176273bb..0b52bcff314e 100644 --- a/xpfe/components/find/public/nsISearchContext.idl +++ b/xpfe/components/find/public/nsISearchContext.idl @@ -48,6 +48,6 @@ interface nsISearchContext : nsISupports { attribute boolean searchBackwards; attribute boolean caseSensitive; attribute boolean wrapSearch; - readonly attribute nsIDOMWindow targetWindow; - attribute nsIDOMWindow findDialog; + readonly attribute nsIDOMWindowInternal targetWindow; + attribute nsIDOMWindowInternal findDialog; }; diff --git a/xpfe/components/find/src/nsFindComponent.cpp b/xpfe/components/find/src/nsFindComponent.cpp index c11e696aff4f..012145013500 100644 --- a/xpfe/components/find/src/nsFindComponent.cpp +++ b/xpfe/components/find/src/nsFindComponent.cpp @@ -39,7 +39,7 @@ #include "nsIURL.h" #include "nsIFactory.h" #include "nsIServiceManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsISound.h" @@ -73,7 +73,7 @@ nsFindComponent::Context::~Context() } NS_IMETHODIMP -nsFindComponent::Context::Init( nsIDOMWindow *aWindow, +nsFindComponent::Context::Init( nsIDOMWindowInternal *aWindow, nsIEditorShell* aEditorShell, const nsString& lastSearchString, const nsString& lastReplaceString, @@ -101,7 +101,7 @@ static NS_DEFINE_CID(kCTextServicesDocumentCID, NS_TEXTSERVICESDOCUMENT_CID); NS_IMETHODIMP -nsFindComponent::Context::MakeTSDocument(nsIDOMWindow* aWindow, nsITextServicesDocument** aDoc) +nsFindComponent::Context::MakeTSDocument(nsIDOMWindowInternal* aWindow, nsITextServicesDocument** aDoc) { if (!aWindow) return NS_ERROR_INVALID_ARG; @@ -559,7 +559,7 @@ nsFindComponent::Context::DoReplace() } NS_IMETHODIMP -nsFindComponent::Context::Reset( nsIDOMWindow *aNewWindow ) +nsFindComponent::Context::Reset( nsIDOMWindowInternal *aNewWindow ) { if (!aNewWindow) return NS_ERROR_INVALID_ARG; @@ -666,7 +666,7 @@ nsFindComponent::Context::SetWrapSearch(PRBool aBool) } NS_IMETHODIMP -nsFindComponent::Context::GetTargetWindow( nsIDOMWindow * *aWindow) +nsFindComponent::Context::GetTargetWindow( nsIDOMWindowInternal * *aWindow) { NS_ENSURE_ARG_POINTER(aWindow); NS_IF_ADDREF(*aWindow = mTargetWindow); @@ -674,7 +674,7 @@ nsFindComponent::Context::GetTargetWindow( nsIDOMWindow * *aWindow) } NS_IMETHODIMP -nsFindComponent::Context::GetFindDialog( nsIDOMWindow * *aDialog) +nsFindComponent::Context::GetFindDialog( nsIDOMWindowInternal * *aDialog) { NS_ENSURE_ARG_POINTER(aDialog); NS_IF_ADDREF(*aDialog = mFindDialog); @@ -682,7 +682,7 @@ nsFindComponent::Context::GetFindDialog( nsIDOMWindow * *aDialog) } NS_IMETHODIMP -nsFindComponent::Context::SetFindDialog( nsIDOMWindow *aDialog ) +nsFindComponent::Context::SetFindDialog( nsIDOMWindowInternal *aDialog ) { mFindDialog = aDialog; return NS_OK; @@ -710,7 +710,7 @@ nsFindComponent::~nsFindComponent() } NS_IMETHODIMP -nsFindComponent::CreateContext( nsIDOMWindow *aWindow, nsIEditorShell* aEditorShell, +nsFindComponent::CreateContext( nsIDOMWindowInternal *aWindow, nsIEditorShell* aEditorShell, nsISupports **aResult ) { @@ -742,7 +742,7 @@ nsFindComponent::CreateContext( nsIDOMWindow *aWindow, nsIEditorShell* aEditorSh return NS_OK; } -static nsresult OpenDialogWithArg( nsIDOMWindow *parent, +static nsresult OpenDialogWithArg( nsIDOMWindowInternal *parent, nsISearchContext *arg, const char *url ) { nsresult rv = NS_OK; @@ -766,7 +766,7 @@ static nsresult OpenDialogWithArg( nsIDOMWindow *parent, (const nsIID*)(&NS_GET_IID(nsISearchContext)), (nsISupports*)arg ); if ( argv ) { - nsIDOMWindow *newWindow; + nsIDOMWindowInternal *newWindow; rv = parent->OpenDialog( jsContext, argv, 4, &newWindow ); if ( NS_SUCCEEDED( rv ) ) { newWindow->Release(); @@ -809,7 +809,7 @@ nsFindComponent::Find(nsISupports *aContext, PRBool *aDidFind) if ( aContext ) { nsCOMPtr context = do_QueryInterface( aContext, &rv ); if ( NS_SUCCEEDED( rv ) && context ) { - nsCOMPtr dialog; + nsCOMPtr dialog; rv = context->GetFindDialog( getter_AddRefs( dialog ) ); if ( NS_SUCCEEDED( rv ) && dialog ) { // Just give focus back to the dialog. @@ -834,16 +834,18 @@ nsFindComponent::Find(nsISupports *aContext, PRBool *aDidFind) // Open Find dialog and prompt for search parameters. char * urlStr = "chrome://global/content/finddialog.xul"; - // We need the parent's nsIDOMWindow... + // We need the parent's nsIDOMWindowInternal... // 1. Get topLevelWindow nsIWebShellContainer (chrome included). - nsCOMPtr window; + nsCOMPtr window; rv = context->GetTargetWindow( getter_AddRefs( window ) ); if ( NS_SUCCEEDED( rv ) && window ) { nsCOMPtr topWindow; window->GetTop(getter_AddRefs(topWindow)); - if (topWindow) - rv = OpenDialogWithArg(topWindow, context, urlStr ); + if (topWindow) { + nsCOMPtr topInternal = do_QueryInterface(topWindow); + rv = OpenDialogWithArg(topInternal, context, urlStr); + } } } else { rv = NS_ERROR_NULL_POINTER; @@ -892,7 +894,7 @@ nsFindComponent::FindNext(nsISupports *aContext, PRBool *aDidFind) NS_IMETHODIMP nsFindComponent::ResetContext( nsISupports *aContext, - nsIDOMWindow *aNewWindow, + nsIDOMWindowInternal *aNewWindow, nsIEditorShell* aEditorShell ) { NS_ENSURE_ARG(aContext); diff --git a/xpfe/components/find/src/nsFindComponent.h b/xpfe/components/find/src/nsFindComponent.h index e62a497c3167..b0315b14525f 100644 --- a/xpfe/components/find/src/nsFindComponent.h +++ b/xpfe/components/find/src/nsFindComponent.h @@ -56,7 +56,7 @@ public: Context(); virtual ~Context(); - NS_IMETHOD Init( nsIDOMWindow *aWindow, + NS_IMETHOD Init( nsIDOMWindowInternal *aWindow, nsIEditorShell* aEditorShell, const nsString& lastSearchString, const nsString& lastReplaceString, @@ -64,23 +64,23 @@ public: PRBool lastSearchBackwards, PRBool lastWrapSearch); - NS_IMETHOD Reset(nsIDOMWindow *aNewWindow); + NS_IMETHOD Reset(nsIDOMWindowInternal *aNewWindow); NS_IMETHOD DoFind(PRBool *aDidFind); NS_IMETHOD DoReplace(); // Utility to construct new TS document from our webshell. - NS_IMETHOD MakeTSDocument(nsIDOMWindow* aWindow, nsITextServicesDocument** aDoc); + NS_IMETHOD MakeTSDocument(nsIDOMWindowInternal* aWindow, nsITextServicesDocument** aDoc); NS_IMETHOD GetCurrentBlockIndex(nsITextServicesDocument *aDoc, PRInt32 *outBlockIndex); NS_IMETHOD SetupDocForSearch(nsITextServicesDocument *aDoc, PRInt32 *outBlockOffset); - nsIDOMWindow* mTargetWindow; // weak link. Don't hold a reference + nsIDOMWindowInternal* mTargetWindow; // weak link. Don't hold a reference nsIEditorShell* mEditorShell; // weak link. Don't hold a reference nsString mSearchString; nsString mReplaceString; PRBool mCaseSensitive; PRBool mSearchBackwards; PRBool mWrapSearch; - nsIDOMWindow* mFindDialog; + nsIDOMWindowInternal* mFindDialog; }; // nsFindComponent::Context diff --git a/xpfe/components/sample/src/nsSampleAppShellComponent.cpp b/xpfe/components/sample/src/nsSampleAppShellComponent.cpp index 701003d6e1e1..718a0281e09d 100644 --- a/xpfe/components/sample/src/nsSampleAppShellComponent.cpp +++ b/xpfe/components/sample/src/nsSampleAppShellComponent.cpp @@ -24,7 +24,7 @@ #include "nsIAppShellComponentImpl.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIXPConnect.h" #include "nsIObserver.h" @@ -101,7 +101,7 @@ nsSampleAppShellComponent::DoDialogTests( nsISupports *parent, nsIObserver *obse if ( parent && observer ) { // Open the dialog from C++. - nsCOMPtr parentWindow = do_QueryInterface( parent, &rv ); + nsCOMPtr parentWindow = do_QueryInterface( parent, &rv ); if ( NS_SUCCEEDED( rv ) ) { // Get JS context from parent window. @@ -139,7 +139,7 @@ nsSampleAppShellComponent::DoDialogTests( nsISupports *parent, nsIObserver *obse "chrome", arg ); if ( argv ) { - nsIDOMWindow *newWindow; + nsIDOMWindowInternal *newWindow; rv = parentWindow->OpenDialog( jsContext, argv, 4, &newWindow ); if ( NS_SUCCEEDED( rv ) ) { newWindow->Release(); diff --git a/xpfe/components/sidebar/public/nsISidebar.idl b/xpfe/components/sidebar/public/nsISidebar.idl index 946245e0da03..b3f3fc447d49 100644 --- a/xpfe/components/sidebar/public/nsISidebar.idl +++ b/xpfe/components/sidebar/public/nsISidebar.idl @@ -24,13 +24,13 @@ #include "nsISupports.idl" -interface nsIDOMWindow; +interface nsIDOMWindowInternal; [scriptable, uuid(577CB745-8CAF-11d3-AAEF-00805F8A4905)] interface nsISidebar : nsISupports { - void setWindow (in nsIDOMWindow aWindow); + void setWindow (in nsIDOMWindowInternal aWindow); void addPanel(in wstring aTitle, in string aContentURL, in string aCustomizeURL); void addSearchEngine(in string engineURL, in string iconURL, diff --git a/xpfe/components/startup/src/nsCommandLineServiceMac.cpp b/xpfe/components/startup/src/nsCommandLineServiceMac.cpp index 34eacfc4d7ff..2e4c85d06480 100644 --- a/xpfe/components/startup/src/nsCommandLineServiceMac.cpp +++ b/xpfe/components/startup/src/nsCommandLineServiceMac.cpp @@ -39,7 +39,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); #include "nsIWebShellWindow.h" #include "nsIWebShell.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "jsapi.h" #include "nsAEEventHandling.h" @@ -301,7 +301,7 @@ nsresult nsMacCommandLine::OpenWindow(const char *chrome, const PRUnichar *url) NS_WITH_SERVICE(nsIAppShellService, appShellService, kAppShellServiceCID, &rv) if (NS_SUCCEEDED(rv)) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext *jsContext; rv = appShellService->GetHiddenWindowAndJSContext( getter_AddRefs( hiddenWindow ), &jsContext ); @@ -317,7 +317,7 @@ nsresult nsMacCommandLine::OpenWindow(const char *chrome, const PRUnichar *url) url ); if(argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog( jsContext, argv, 4, diff --git a/xpfe/components/ucth/public/nsIUnkContentTypeHandler.idl b/xpfe/components/ucth/public/nsIUnkContentTypeHandler.idl index ce244803da97..73a7be431161 100644 --- a/xpfe/components/ucth/public/nsIUnkContentTypeHandler.idl +++ b/xpfe/components/ucth/public/nsIUnkContentTypeHandler.idl @@ -45,7 +45,7 @@ interface nsIUnknownContentTypeHandler : nsIAppShellComponent { void HandleUnknownContentType( in nsIChannel aURL, in string aContentType, - in nsIDOMWindow aWindow ); + in nsIDOMWindowInternal aWindow ); }; diff --git a/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp b/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp index a0bbdb1c7303..dddf3abba2fc 100644 --- a/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp +++ b/xpfe/components/ucth/src/nsUnknownContentTypeHandler.cpp @@ -26,7 +26,7 @@ #include "nsIAppShellComponentImpl.h" #include "nsString.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "nsIChannel.h" #include "nsIURI.h" @@ -83,7 +83,7 @@ public: NS_IMETHODIMP nsUnknownContentTypeHandler::HandleUnknownContentType( nsIChannel *aChannel, const char *aContentType, - nsIDOMWindow *aWindow ) { + nsIDOMWindowInternal *aWindow ) { nsresult rv = NS_OK; nsCOMPtr channel; @@ -141,7 +141,7 @@ nsUnknownContentTypeHandler::HandleUnknownContentType( nsIChannel *aChannel, aContentType, (const char*)contentDisp.GetBuffer() ); if ( argv ) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = aWindow->OpenDialog( jsContext, argv, 6, getter_AddRefs( newWindow ) ); if ( NS_FAILED( rv ) ) { DEBUG_PRINTF( PR_STDOUT, "%s %d: OpenDialog failed, rv=0x%08X\n", @@ -183,7 +183,7 @@ nsUnknownContentTypeHandler::Show( nsIHelperAppLauncher *aLauncher, nsISupports nsresult rv = NS_ERROR_FAILURE; // Get parent window (from context). - nsCOMPtr parent( do_GetInterface( aContext ) ); + nsCOMPtr parent( do_GetInterface( aContext ) ); if ( parent ) { // Get JS context from parent window. nsCOMPtr sgo = do_QueryInterface( parent, &rv ); @@ -206,7 +206,7 @@ nsUnknownContentTypeHandler::Show( nsIHelperAppLauncher *aLauncher, nsISupports (nsISupports*)aLauncher ); if ( argv ) { // Open the dialog. - nsCOMPtr dialog; + nsCOMPtr dialog; rv = parent->OpenDialog( jsContext, argv, 6, getter_AddRefs( dialog ) ); // Pop arguments. JS_PopArguments( jsContext, stackPtr ); diff --git a/xpfe/components/urlwidget/nsIUrlWidget.idl b/xpfe/components/urlwidget/nsIUrlWidget.idl index d4f7c6baaae7..d7b51f031ed3 100644 --- a/xpfe/components/urlwidget/nsIUrlWidget.idl +++ b/xpfe/components/urlwidget/nsIUrlWidget.idl @@ -40,7 +40,7 @@ interface nsIUrlWidget : nsISupports { | Set the currently displayed url to a hidden edit control. | | Created the edit control, if not already created. | --------------------------------------------------------------*/ - void SetURLToHiddenControl( in string aURL, in nsIDOMWindow parent ); + void SetURLToHiddenControl( in string aURL, in nsIDOMWindowInternal parent ); }; //Used in navigator.js to instantiate and call this class. diff --git a/xpfe/components/urlwidget/nsUrlWidget.cpp b/xpfe/components/urlwidget/nsUrlWidget.cpp index 74242c7bdb11..e8ef0b59627a 100644 --- a/xpfe/components/urlwidget/nsUrlWidget.cpp +++ b/xpfe/components/urlwidget/nsUrlWidget.cpp @@ -29,7 +29,7 @@ #include "nsIGenericFactory.h" #include "nsIScriptContext.h" #include "nsIScriptGlobalObject.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIBaseWindow.h" #include "nsIWidget.h" #include "nsCOMPtr.h" @@ -65,7 +65,7 @@ nsUrlWidget::Init() } NS_IMETHODIMP -nsUrlWidget::SetURLToHiddenControl( char const *aURL, nsIDOMWindow *parent ) +nsUrlWidget::SetURLToHiddenControl( char const *aURL, nsIDOMWindowInternal *parent ) { nsresult rv = NS_OK; HWND hEdit=NULL; // Handle to the hidden editbox control. diff --git a/xpfe/components/xfer/public/nsIStreamTransfer.idl b/xpfe/components/xfer/public/nsIStreamTransfer.idl index 413c6fedcbd7..41fb59e40f54 100644 --- a/xpfe/components/xfer/public/nsIStreamTransfer.idl +++ b/xpfe/components/xfer/public/nsIStreamTransfer.idl @@ -50,7 +50,7 @@ interface nsIStreamTransfer : nsIAppShellComponent { | dialog. | --------------------------------------------------------------------------*/ [noscript] void SelectFileAndTransferLocation( in nsIChannel aChannel, - in nsIDOMWindow parent ); + in nsIDOMWindowInternal parent ); /*------------------ SelectFileAndTransferLocationSpec --------------------- | Prompt the user for a destination file and then transfer the data, using | @@ -58,7 +58,7 @@ interface nsIStreamTransfer : nsIAppShellComponent { | dialog. You can provide a content type and/or a suggested file name. | --------------------------------------------------------------------------*/ void SelectFileAndTransferLocationSpec( in string aURL, - in nsIDOMWindow parent, + in nsIDOMWindowInternal parent, in string contentType, in string suggestedName ); }; diff --git a/xpfe/components/xfer/src/nsStreamTransfer.cpp b/xpfe/components/xfer/src/nsStreamTransfer.cpp index 1204b18800ed..908addb13afa 100644 --- a/xpfe/components/xfer/src/nsStreamTransfer.cpp +++ b/xpfe/components/xfer/src/nsStreamTransfer.cpp @@ -63,13 +63,13 @@ public: protected: // Common implementation that takes contentType and suggestedName. NS_IMETHOD SelectFileAndTransferLocation( nsIChannel *aChannel, - nsIDOMWindow *parent, + nsIDOMWindowInternal *parent, char const *contentType, char const *suggestedName ); private: // Put up file picker dialog. - NS_IMETHOD SelectFile( nsIDOMWindow *parent, nsIFileSpec **result, const nsCString &suggested ); + NS_IMETHOD SelectFile( nsIDOMWindowInternal *parent, nsIFileSpec **result, const nsCString &suggested ); nsCString SuggestNameFor( nsIChannel *aChannel, char const *suggestedName ); // Objects of this class are counted to manage library unloading... @@ -78,7 +78,7 @@ private: // Get content type and suggested name from input channel in this case. NS_IMETHODIMP -nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel, nsIDOMWindow *parent ) { +nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel, nsIDOMWindowInternal *parent ) { // Content type comes straight from channel. nsXPIDLCString contentType; aChannel->GetContentType( getter_Copies( contentType ) ); @@ -114,7 +114,7 @@ nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel, nsIDOMWin NS_IMETHODIMP nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel, - nsIDOMWindow *parent, + nsIDOMWindowInternal *parent, char const *contentType, char const *suggestedName ) { // Prompt the user for the destination file. @@ -168,7 +168,7 @@ nsStreamTransfer::SelectFileAndTransferLocation( nsIChannel *aChannel, NS_IMETHODIMP nsStreamTransfer::SelectFileAndTransferLocationSpec( char const *aURL, - nsIDOMWindow *parent, + nsIDOMWindowInternal *parent, char const *contentType, char const *suggestedName ) { nsresult rv = NS_OK; @@ -196,7 +196,7 @@ nsStreamTransfer::SelectFileAndTransferLocationSpec( char const *aURL, } NS_IMETHODIMP -nsStreamTransfer::SelectFile( nsIDOMWindow *parent, nsIFileSpec **aResult, const nsCString &suggested ) { +nsStreamTransfer::SelectFile( nsIDOMWindowInternal *parent, nsIFileSpec **aResult, const nsCString &suggested ) { nsresult rv = NS_OK; if ( aResult ) { diff --git a/xpfe/components/xfer/src/nsStreamXferOp.cpp b/xpfe/components/xfer/src/nsStreamXferOp.cpp index 5d37262555a6..742114e48af0 100644 --- a/xpfe/components/xfer/src/nsStreamXferOp.cpp +++ b/xpfe/components/xfer/src/nsStreamXferOp.cpp @@ -30,7 +30,7 @@ #include "nsIObserver.h" // For opening dialog. -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIScriptGlobalObject.h" #include "jsapi.h" @@ -78,9 +78,9 @@ nsStreamXferOp::~nsStreamXferOp() { #endif } -// Invoke nsIDOMWindow::OpenDialog, passing this object as argument. +// Invoke nsIDOMWindowInternal::OpenDialog, passing this object as argument. NS_IMETHODIMP -nsStreamXferOp::OpenDialog( nsIDOMWindow *parent ) { +nsStreamXferOp::OpenDialog( nsIDOMWindowInternal *parent ) { nsresult rv = NS_OK; // Get JS context from parent window. nsCOMPtr sgo = do_QueryInterface( parent, &rv ); @@ -100,10 +100,10 @@ nsStreamXferOp::OpenDialog( nsIDOMWindow *parent ) { (const nsIID*)(&NS_GET_IID(nsIStreamTransferOperation)), (nsISupports*)(nsIStreamTransferOperation*)this ); if ( argv ) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = parent->OpenDialog( jsContext, argv, 4, getter_AddRefs( newWindow ) ); if ( NS_FAILED( rv ) ) { - DEBUG_PRINTF( PR_STDOUT, "%s %d: nsIDOMWindow::OpenDialog failed, rv=0x%08X\n", + DEBUG_PRINTF( PR_STDOUT, "%s %d: nsIDOMWindowInternal::OpenDialog failed, rv=0x%08X\n", (char*)__FILE__, (int)__LINE__, (int)rv ); } JS_PopArguments( jsContext, stackPtr ); diff --git a/xpfe/components/xfer/src/nsStreamXferOp.h b/xpfe/components/xfer/src/nsStreamXferOp.h index 08bd3692962e..796da4cdcd66 100644 --- a/xpfe/components/xfer/src/nsStreamXferOp.h +++ b/xpfe/components/xfer/src/nsStreamXferOp.h @@ -32,7 +32,7 @@ #include "nsCOMPtr.h" -class nsIDOMWindow; +class nsIDOMWindowInternal; // Define USE_ASYNC_READ in order to implement stream transfer using AsyncRead // (and synchronous file writes) versus AsyncWrite. @@ -60,7 +60,7 @@ public: virtual ~nsStreamXferOp(); // Implementation. - NS_IMETHOD OpenDialog( nsIDOMWindow *parent ); + NS_IMETHOD OpenDialog( nsIDOMWindowInternal *parent ); NS_IMETHOD OnError( int operation, nsresult rv ); // Declare inherited interfaces. diff --git a/xpinstall/src/nsInstallProgressDialog.cpp b/xpinstall/src/nsInstallProgressDialog.cpp index 014e57749bea..1ca966b34560 100644 --- a/xpinstall/src/nsInstallProgressDialog.cpp +++ b/xpinstall/src/nsInstallProgressDialog.cpp @@ -29,7 +29,7 @@ #include "nsIAppShellComponentImpl.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIServiceManager.h" #include "nsIDocumentViewer.h" #include "nsIContent.h" @@ -148,7 +148,7 @@ nsInstallProgressDialog::Open(nsIDialogParamBlock* ioParamBlock) NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv ); if ( NS_SUCCEEDED( rv ) ) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext* jsContext; rv = appShell->GetHiddenWindowAndJSContext( getter_AddRefs(hiddenWindow), &jsContext); if (NS_SUCCEEDED(rv)) diff --git a/xpinstall/src/nsInstallProgressDialog.h b/xpinstall/src/nsInstallProgressDialog.h index 8a3316e5f5fb..9a0130cdbb6b 100644 --- a/xpinstall/src/nsInstallProgressDialog.h +++ b/xpinstall/src/nsInstallProgressDialog.h @@ -35,7 +35,7 @@ #include "nsPIXPIManagerCallbacks.h" #include "nsIDocument.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsIDOMDocument.h" #include "nsIDOMXULDocument.h" @@ -65,6 +65,6 @@ class nsInstallProgressDialog : public nsIXPIListener, private: nsPIXPIManagerCallbacks* mManager; nsCOMPtr mDocument; // Should this be a weak reference? - nsCOMPtr mWindow; // Should this be a weak reference? + nsCOMPtr mWindow; // Should this be a weak reference? }; #endif diff --git a/xpinstall/src/nsXPInstallManager.cpp b/xpinstall/src/nsXPInstallManager.cpp index f54c8e3ae7a6..98d09510791c 100644 --- a/xpinstall/src/nsXPInstallManager.cpp +++ b/xpinstall/src/nsXPInstallManager.cpp @@ -50,7 +50,7 @@ #include "nsInstallResources.h" #include "nsSpecialSystemDirectory.h" #include "nsIProxyObjectManager.h" -#include "nsIDOMWindow.h" +#include "nsIDOMWindowInternal.h" #include "nsDirectoryService.h" #include "nsDirectoryServiceDefs.h" #include "nsAppDirectoryServiceDefs.h" @@ -260,7 +260,7 @@ PRBool nsXPInstallManager::ConfirmInstall(nsIDialogParamBlock* ioParamBlock) NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv ); if ( NS_SUCCEEDED( rv ) ) { - nsCOMPtr hiddenWindow; + nsCOMPtr hiddenWindow; JSContext* jsContext; rv = appShell->GetHiddenWindowAndJSContext( getter_AddRefs(hiddenWindow), &jsContext); if (NS_SUCCEEDED(rv)) @@ -277,7 +277,7 @@ PRBool nsXPInstallManager::ConfirmInstall(nsIDialogParamBlock* ioParamBlock) if (argv) { - nsCOMPtr newWindow; + nsCOMPtr newWindow; rv = hiddenWindow->OpenDialog( jsContext, argv, 4, @@ -364,7 +364,7 @@ PRBool nsXPInstallManager::ConfirmChromeInstall() NS_IMETHODIMP nsXPInstallManager::DialogOpened(nsISupports* aWindow) { nsresult rv; - nsCOMPtr win = do_QueryInterface(aWindow, &rv); + nsCOMPtr win = do_QueryInterface(aWindow, &rv); DownloadNext(); return rv; }