From 5874d635ea05b34767f8bfaa4493aa246cdf0c12 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Tue, 18 May 1999 10:29:48 +0000 Subject: [PATCH] Popup arbitrary XUL lives! git-svn-id: svn://10.0.0.236/trunk@32068 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/appshell/src/nsWebShellWindow.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 48cad970660..6f863055935 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -995,18 +995,16 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont nsCOMPtr browserWindow = do_QueryInterface(newWindow); browserWindow->MoveTo(aXPos, aYPos); - // Get the webshell + // (2) Get the webshell nsCOMPtr newShell; newWindow->GetWebShell(*getter_AddRefs(newShell)); - // (2) Set the opener property to link the popup to the parent. nsCOMPtr domWindow; if (NS_FAILED(rv = ConvertWebShellToDOMWindow(newShell, getter_AddRefs(domWindow)))) { NS_ERROR("Unable to retrieve the DOM window from the new web shell."); return rv; } - domWindow->SetOpener(aWindow); - + // (3) We need to create a new document that clones the original document's popup // content. This new document must use the different root and a different global script // context (window object) but everything else about it is the same (namespaces, URLs, @@ -1076,12 +1074,15 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont nsCOMPtr blurListener = do_QueryInterface(popupListener); nsCOMPtr targetWindow = do_QueryInterface(domWindow); targetWindow->AddEventListener("blur", blurListener, PR_FALSE, PR_FALSE); - - // (8) Show the window, and give the window the focus. + + // (8) Set up the opener property + domWindow->SetOpener(aWindow); + + // (9) Show the window, and give the window the focus. newWindow->Show(PR_TRUE); domWindow->Focus(); - // (9) Do some layout. + // (10) Do some layout. nsCOMPtr popupChild = do_QueryInterface(popupDocument); popupChild->LayoutPopupDocument();